Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

ASP.NET Online form

Options
  • 23-04-2012 10:46am
    #1
    Registered Users Posts: 108 ✭✭


    This is my first time using visual studio and coding in asp.net. I have to design a form that has to be added to a project that is already created. The file is an aspx file but the two attached to it are vb files where they have to be cs files as the files in the project that I have to add my file too are cs files. Can anyone tell me how to change them to cs files and what the code that goes into those files has to do?? I'm really lost here and I'm getting rode to finish this project....

    Any useful links to tutorials would be greatly appreciated also...


Comments

  • Registered Users Posts: 2,791 ✭✭✭John_Mc


    HotP0pp3r wrote: »
    This is my first time using visual studio and coding in asp.net. I have to design a form that has to be added to a project that is already created. The file is an aspx file but the two attached to it are vb files where they have to be cs files as the files in the project that I have to add my file too are cs files. Can anyone tell me how to change them to cs files and what the code that goes into those files has to do?? I'm really lost here and I'm getting rode to finish this project....

    Any useful links to tutorials would be greatly appreciated also...

    You can develop ASP.net forms using C# or Visual Basic. Your files have the extension vb because they are the latter whereas you need the former.

    If you are creating the new page in a new project and then you are going to copy them into the existing project, then your new project needs to be C#. Visual studio defaults to VB so unless you change it to C# at the time of creating the project then that's what you'll get.

    I obviously can't tell you what code needs to go on that page as I don't know anything about it...


  • Registered Users Posts: 2,494 ✭✭✭kayos


    You have

    page.aspx (Contains your html/asp controls)
    page.vb (contains your code)
    page.designer.vb (contains the definition of the controls etc for the page)

    They all go together to make up a functioning ASP.NET Page.

    The difference between the .vb and .cs extensions are easy. Files with Visual Basic have the vb extension, files with C# have the cs extension.

    If the project is already in place and it is a C# project I don't believe you would be able to add your vb pages and expect it to work (sorry not an area I have ever had to look at as I only do c#). While VB and C# do inter-operate fine I don't think you can have mixed language projects. Would you expect to be able to compile C++ Code and Java Code into a single binary?

    But why are you adding an existing page when you have to design it? Did you by chance design it in a completely separate project that was set to use VB? Just Add a new ASP.NET page to your existing project from within Visual Studio. And then add your controls and the code you require. No one will be able to explain to you what your code has to do as we don't know what the requirements are.

    I am guessing you have no .NET Experience whats so ever based on your questions. Does you boss know this?


  • Registered Users Posts: 3,336 ✭✭✭Hamilcar


    If the existing project is C#, then if you add a new page it will be a c# page. Sounds to me like you,ve created a brand new project which defaults to VB. Yuo need to add a page to the existing project. Regarding the code .cs and .vb is the codebehind for the aspx page. This separates page design and code and is good programming practice


Advertisement