Migration Approach

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 5.  Migration Approach for ASP to ASP.NET


ASP.NET offers significant improvements over ASP in areas such as performance, state management, application configuration and deployment, scalability, security, and Web farm support. The structured and object-oriented approach of .NET is a major difference ASP developers will come across when migrating to ASP.NET. This means that the existing ASP pages need to undergo some modification before they can run as ASP.NET pages.

Most developers might choose to rewrite the existing ASP application entirely to migrate it to ASP.NET. But because ASP.NET is designed to be backward compatible with ASP, this is not necessary. The ASP Web application can be rewritten only in certain areas that can ensure maintainability of code and guarantee an improvement in performance. It is entirely possible to have some part of a Web application in ASP while the rest is in ASP.NET because ASP and ASP.NET pages can coexist within the same application on a Web server.

VBScript, the preferred language for developing ASP applications, is no longer used in ASP.NET. It has been replaced by Visual Basic .NET. An application developer migrating an ASP application written in VBScript to ASP.NET may choose any other .NET-compliant language, but Visual Basic .NET should be the preferred language for migration because changing languages while migrating an application may require additional effort. In such a case, more often than not, the changes necessary to migrate an application will not involve more than a few lines of code per page of the application.

The first noticeable thing about working with ASP.NET is that the pages have a file extension of .aspx instead of .asp as in ASP applications. ASP is implemented as a system ISAPI DLL ( asp.dll ), also known as the ASP runtime. Whenever a request for an ASP page is made, IIS loads the runtime and uses it to process the pages. The execution of ASP.NET pages is carried out by the ASP.NET worker process ( aspnet_wp.exe ). Configuration in ASP involves the metabase and registry, and any changes made to the configuration are reflected in the metabase. In ASP.NET, the configuration settings are stored in XML-based documents that allow for hierarchical storage of configuration data. Thus, due to separate processing engines and configuration setup, ASP and ASP.NET pages can coexist in one Web application. This is known as side-by-side deployment. But due to the difference in processing of ASP and ASP.NET pages, session state cannot be shared across two technologies.

Migrating existing ASP applications to ASP.NET is definitely not as easy as simply changing the file extension from .asp to .aspx. The differences in VBScript and Visual Basic .NET may involve a lot of code change, but most of these changes are purely syntactical. Compatibility issues arising during migration can be broadly categorized into API, semantic, and language changes. API changes include zero-based arrays and changes in return types. Semantic changes mean there can only be one language per page, functions must be in script blocks, and ASP.NET no longer supports render functions and in-line code. This will be covered in detail in Chapter 7.

The migration approach for ASP to ASP.NET can be divided into four basic steps:

  1. Considerations for migration . This discusses the vertical and horizontal approach to migration and presents guidelines on selecting an application for migration.

  2. Pre-migration strategy . This applies to the existing ASP Web application before migrating to ASP.NET. It involves code changes in existing application and IIS server settings.

  3. Creating a new ASP.NET Web application . This provides a step-by-step guide to creating a new Web application using Visual Studio .NET.

  4. Changes required in the ASP.NET code . This involves a detailed discussion on language and syntactical changes due to certain differences in VBScript and Visual Basic .NET. The categorization will be based on functionality such as database-handling techniques, Web controls, and handling COM components and will involve comparisons between ASP and ASP.NET code at every step.

This chapter will discuss how to the begin with migration of an existing ASP application described in the first two steps, and the last two steps will be discussed in the next chapter.


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