Creating an ASP.NET Web Application

Snoops

   

 
Migrating to .NET: A Pragmatic Path to Visual Basic .NET, Visual C++ .NET, and ASP.NET
By Dhananjay Katre, Prashant Halari, Narayana Rao Surapaneni, Manu Gupta, Meghana Deshpande

Table of Contents
Chapter 6.  Migrating to ASP.NET I


In classic ASP a Web application comprises a collection of .asp files along with the global.asa . ASP.NET expands on the concept with the addition of ASP.NET ( .aspx ) files, the global.asax , a configuration ( web.config ) file, resource ( .resx ) files, and optional user controls and Web services. In an ASP.NET Web application the .aspx file is a Web Forms page containing user interface elements and the programming logic associated with them, similar to .asp pages. The global.asax contains code for handling application and session-level events raised by ASP.NET. Application configuration settings are stored in web.config in readable XML format.

When migrating ASP applications to ASP.NET, start by creating an ASP.NET Web application. An ASP.NET Web application can be created by creating a folder under the inetpub/ wwwroot directory, configuring it as an application in IIS, and adding the preceding elements to it. When migrating ASP pages to ASP.NET, we can begin, as suggested in the migration approach, by simply renaming .asp files to .aspx and adding them to the Web application. This entire process can be simplified by using Visual Studio .NET. In this section, we describe how to create a Web application in .NET using Visual Studio .NET:

  1. Open the Visual Studio .NET IDE and click on File New Project. Select ASP.NET Web Application under Visual Basic Projects. See Figure 6-1.

    Figure 6-1. Create a new Web application.

    graphics/06fig01.gif

  2. Click on Browse and select the folder where the ASP project exists. See Figure 6-2.

    Figure 6-2. Browsing to point to the ASP application.

    graphics/06fig02.gif

  3. Click Open. The path of the project will appear in the file dialog box under Location. See Figure 6-3.

    Figure 6-3. Selecting the project.

    graphics/06fig03.gif

  4. Click OK to start creating the project files. When the solution explorer is displayed, you'll find that none of the .asp files are seen in the project. To make these files visible, click on Show All Files under Project. See Figure 6-4.

    Figure 6-4. Show all files in the project.

    graphics/06fig04.gif

  5. The solution window for the project now looks as shown in Figure 6-5.

    Figure 6-5. Solution explorer showing all files in the Web application.

    graphics/06fig05.gif


Snoops

   
Top


Migrating to. NET. A Pragmatic Path to Visual Basic. NET, Visual C++. NET, and ASP. NET
Migrating to. NET. A Pragmatic Path to Visual Basic. NET, Visual C++. NET, and ASP. NET
ISBN: 131009621
EAN: N/A
Year: 2001
Pages: 149

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