Migrating Visual Basic 6 ASP Web Applications

As is true with VB6 Windows applications, you have options when it comes to migrating VB6 ASP Web applications to ASP.NET. The first thing to point out is that ASP and ASP.NET applications can coexist. Thus it is worthwhile to evaluate whether to migrate at all. Microsoft also recommends reading "Migrating Your ASP Applications to ASP.NET" and "Migrating to ASP.NET: Key Considerations" before you migrate. Both of these articles are available at http://msdn.microsoft.com.

To get you started, here's an overview of the steps that will help you migrate to ASP.NET.

  1. Start Visual Studio .NET.

  2. Open an existing ASP application or add an existing ASP application to the opened solution.

  3. Select FileAdd Existing Item and navigate to the ASP file.

  4. Right-click on the .asp file in the Solution Explorer and change the extension to .aspx .

  5. A dialog will appear suggesting that the name change will invalidate the file. Click Yes.

  6. Visual Studio .NET will automatically add a code-behind file. For example, if your file is named home.aspx , a code-behind file named code.aspx.vb will be added and associated with the .aspx file. (You can see the newly associated code-behind file if you click the Show All Files toolbar button at the top of the Solution Explorer.)

  7. You will need to check the HTML and make sure that a <form> element exists. The <form> element must contain the runat ="server" attribute.

  8. After step 7 you should be able to compile and run the ASP.NET application, browsing to the new page.

To keep it simple, if you change the names of your .asp files to .aspx files and open them in Visual Basic .NET, they will be treated as .aspx files. To make them more powerful you may want to migrate specific controls to Web server controls and add a code-behind file to the .aspx.vb file created by the IDE. However, simply renaming the extension will get you well under way.



Visual Basic. NET Power Coding
Visual Basic(R) .NET Power Coding
ISBN: 0672324075
EAN: 2147483647
Year: 2005
Pages: 215
Authors: Paul Kimmel

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net