43
Migration from ASP to Migration from ASP to ASP.NET ASP.NET Anand M. Hegde Anand M. Hegde Developer Support Engineer Developer Support Engineer Microsoft Developer Support Microsoft Developer Support Microsoft Corporation Microsoft Corporation

Migration from ASP to ASP.NET

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Migration from ASP to ASP.NET

Migration from ASP to Migration from ASP to ASP.NETASP.NET

Anand M. HegdeAnand M. HegdeDeveloper Support Engineer Developer Support Engineer Microsoft Developer Support Microsoft Developer Support Microsoft CorporationMicrosoft Corporation

Page 2: Migration from ASP to ASP.NET

2

OverviewOverview

Why should you migrate? Why should you migrate? Introduction to Microsoft® ASP.NETIntroduction to Microsoft® ASP.NET Key changes from ASP to ASP.NETKey changes from ASP to ASP.NET Migrating from ASP to ASP.NETMigrating from ASP to ASP.NET Migrating applications that use COM Migrating applications that use COM

componentscomponents Migrating applications that use databasesMigrating applications that use databases Migration best practicesMigration best practices ASP to ASP.NET compatibility FAQASP to ASP.NET compatibility FAQ Resources for ASP.NET and migration Resources for ASP.NET and migration

Page 3: Migration from ASP to ASP.NET

3

Why Should You Migrate?Why Should You Migrate?

Increased scalability and reliabilityIncreased scalability and reliability Minimum 2X to 3X performance gainMinimum 2X to 3X performance gain Built-in cross-browser compatibilityBuilt-in cross-browser compatibility Rich server-side controls, Microsoft Rich server-side controls, Microsoft

Visual Studio® .NET designer support, and Visual Studio® .NET designer support, and configuration optionsconfiguration options

X-copy deployment of pages and componentsX-copy deployment of pages and components Better debugger; tracing optionsBetter debugger; tracing options Content-code separationContent-code separation Take advantage of new caching featuresTake advantage of new caching features Enhanced state-management featuresEnhanced state-management features ASP and ASP.NET can run side-by-side if requiredASP and ASP.NET can run side-by-side if required Many new featuresMany new features

Page 4: Migration from ASP to ASP.NET

4

Before You MigrateBefore You Migrate

Get a good understanding of ASP.NETGet a good understanding of ASP.NET Know the changes from ASP to ASP.NET Know the changes from ASP to ASP.NET Understand that migration requires code Understand that migration requires code

changeschanges Although ASP.NET has excellent backward Although ASP.NET has excellent backward

compatibility, migration may not be as easy compatibility, migration may not be as easy as it seems in many casesas it seems in many cases

Page 5: Migration from ASP to ASP.NET

5

Introduction to ASP.NETIntroduction to ASP.NET

ASP.NET is:ASP.NET is: A new programming framework for Web A new programming framework for Web

applicationsapplications An overhaul of ASPAn overhaul of ASP A part of Microsoft .NETA part of Microsoft .NET Compiled and event driven programming modelCompiled and event driven programming model

It permits you to:It permits you to: Rapidly develop powerful Web applications and Rapidly develop powerful Web applications and

servicesservices Easily build, deploy, and run Web applications Easily build, deploy, and run Web applications

that can target any browser or device that can target any browser or device It requires:It requires:

Microsoft Windows® 2000 or later for hosting and Microsoft Windows® 2000 or later for hosting and developmentdevelopment

Page 6: Migration from ASP to ASP.NET

6

ASP.NET ArchitectureASP.NET Architecture

Page 7: Migration from ASP to ASP.NET

7

ASP.NET Request FlowASP.NET Request Flow

ASPXASPXfilefile

RequestRequest

ASPXASPX

engineengine

ParseParse

Gen’dGen’dpagepageclassclassfilefile

GenerateGenerate

Instantiate, Instantiate, process, and process, and

renderrender

ResponseResponse

RequestRequest

CodeCodebehindbehindclassclassfilefile

ResponseResponsePagePage

classclass

InstantiateInstantiate

Page 8: Migration from ASP to ASP.NET

8

ASP.NET Page Life CycleASP.NET Page Life Cycle

ASP.NET pages are event based ASP.NET pages are event based Event flow in ASPX pagesEvent flow in ASPX pages

Page_Init: the page and controls are Page_Init: the page and controls are initialized initialized

Page_Load: all the controls and page are Page_Load: all the controls and page are loadedloaded

Change events for controls are processedChange events for controls are processed Click events for controls are processedClick events for controls are processed Page_PreRender: page is about to renderPage_PreRender: page is about to render Page_Unload: page is unloaded from Page_Unload: page is unloaded from

memorymemory

Page 9: Migration from ASP to ASP.NET

9

ASP Programming ModelsASP Programming Models

Two types of programming models existTwo types of programming models exist ASPX page only: contains HTML, control tags, ASPX page only: contains HTML, control tags,

and codeand code Code behind model: ASPX file contains HTML and Code behind model: ASPX file contains HTML and

control tags, and a “code behind” file contains control tags, and a “code behind” file contains code code A true separation between code and contentA true separation between code and content

One File Two files. (“code behind” model)

Page.aspx Page.aspx Page.aspx.vb

<Tags> + Code

<Tags> Code

Page 10: Migration from ASP to ASP.NET

10

ASP.NET FeaturesASP.NET Features

Life made easy for developersLife made easy for developers Excellent backward compatibility with classic Excellent backward compatibility with classic

ASPASP Visual Studio designer support, rich server Visual Studio designer support, rich server

controls, and base class library supportcontrols, and base class library support Write code in the language of your choiceWrite code in the language of your choice Call Microsoft Win32® APIs directlyCall Microsoft Win32® APIs directly Structured error handlingStructured error handling Great debugging and tracing supportGreat debugging and tracing support

Page 11: Migration from ASP to ASP.NET

11

ASP.NET Features ASP.NET Features (2)(2)

Performance, scalability, and reliabilityPerformance, scalability, and reliability Compiled code means speedCompiled code means speed Cache APIs to improve performance and Cache APIs to improve performance and

scalabilityscalability Built-in support for WebFarms and WebGardensBuilt-in support for WebFarms and WebGardens Nonstop availability and protection against Nonstop availability and protection against

deadlocks, memory leaks, and so ondeadlocks, memory leaks, and so on

Page 12: Migration from ASP to ASP.NET

12

ASP.NET Features ASP.NET Features (3)(3)

Easy deploymentEasy deployment X-copy deployment X-copy deployment Dynamic updates without interrupting the serviceDynamic updates without interrupting the service No more registry! No more registry! — u— use XML-based configuration se XML-based configuration

filesfiles

New application modelsNew application models Develop mobile Internet applications with easeDevelop mobile Internet applications with ease Built-in support to use XML WebServicesBuilt-in support to use XML WebServices

More control with the new security modelMore control with the new security model Flexible session state managementFlexible session state management Many other new featuresMany other new features

Page 13: Migration from ASP to ASP.NET

13

Core Object ChangesCore Object Changes Request object changes:Request object changes:

Request(item)Request(item), , Request.QueryString(item)Request.QueryString(item),, and and Request.Form(item)Request.Form(item) now return a name value now return a name value collectioncollection In classic ASP, they return an array of stringsIn classic ASP, they return an array of strings

Use Response.Write with cautionUse Response.Write with caution It will output results at the top of the page before It will output results at the top of the page before

the <HTML> tag the <HTML> tag Instead:Instead:

Use server controls (placeholder)Use server controls (placeholder) Use <% %> tags if you want the output to appear in the Use <% %> tags if you want the output to appear in the

right placeright place

Each of the core objects now have many new Each of the core objects now have many new properties and methods. properties and methods.

There are some new objects availableThere are some new objects available For example: cache, user and traceFor example: cache, user and trace

Page 14: Migration from ASP to ASP.NET

14

Structural ChangesStructural Changes

One page – one languageOne page – one language No mixing of languages in single pageNo mixing of languages in single page

A page can have only one server-side Form A page can have only one server-side Form tag and it must submit to the same pagetag and it must submit to the same page

An ASPX page may contain:An ASPX page may contain: Directives: Directives: <%@ Directive %><%@ Directive %> Server controls: Server controls: <tag runat=server><tag runat=server>

Code blocks: Code blocks: <script runat=server><script runat=server>

Data binding expressions: Data binding expressions: <%# %><%# %>

Server-side comments: Server-side comments: <%-- --%><%-- --%>

Server-side includes: Server-side includes: <!-- #include --><!-- #include -->

Render code: Render code: <%= %> and <% %><%= %> and <% %>

Page 15: Migration from ASP to ASP.NET

15

Structural Changes Structural Changes (2)(2)

Code blockCode block––related changesrelated changes You cannot declare functions inside <% %> tagsYou cannot declare functions inside <% %> tags Declare all your functions and variables inside the Declare all your functions and variables inside the

server-side <SCRIPT> blocksserver-side <SCRIPT> blocks

<Script runat=“server” language=“vb”><Script runat=“server” language=“vb”> dim gVar as String ‘Page level variabledim gVar as String ‘Page level variable private sub MySubRoutine()private sub MySubRoutine() Label1.Text = gVarLabel1.Text = gVar End SubEnd Sub</Script ></Script >

Page 16: Migration from ASP to ASP.NET

16

Structural Changes Structural Changes (3)(3)

No Render functions permitedNo Render functions permited Change:Change:

<% MyRenderFunction<% MyRenderFunction

Sub MyRenderFunction() %>Sub MyRenderFunction() %>

<h1> Hi there! </h1><h1> Hi there! </h1>

<%end sub%><%end sub%>

To:To:<% Call MyRenderFunction()%><% Call MyRenderFunction()%>

<script runat=“server” language=“vb”><script runat=“server” language=“vb”>

Response.Write(“Hi there!”)Response.Write(“Hi there!”)

</script></script>

Page 17: Migration from ASP to ASP.NET

17

Structural Changes Structural Changes (4)(4)

New page directivesNew page directives In ASP, directives had to be at the top of the page, In ASP, directives had to be at the top of the page,

but you do not have to do this anymorebut you do not have to do this anymore You can now have multiple directives on the same You can now have multiple directives on the same

pagepage Sample page directive: Sample page directive:

<%@ Page Language="VB" ContentType="text/xml" %><%@ Page Language="VB" ContentType="text/xml" %> See the See the documents on new page directives

Page 18: Migration from ASP to ASP.NET

18

Application Configuration Application Configuration ChangesChanges ASP.NET application settings are stored in ASP.NET application settings are stored in

XML configuration filesXML configuration files Types of configuration filesTypes of configuration files

Machine.config Machine.config Contains machine-wide settings Contains machine-wide settings

Web.ConfigWeb.Config Contains project/application-wide settingsContains project/application-wide settings

Easy programmatic access to the data in Easy programmatic access to the data in these filesthese files

Some of the settings in the IIS snap-in are Some of the settings in the IIS snap-in are ignoredignored For example: application protection level, session For example: application protection level, session

statestate

Page 19: Migration from ASP to ASP.NET

19

Session Management ChangesSession Management Changes New session state storage mechanismsNew session state storage mechanisms

InProc InProc – – session data stored on local session data stored on local computer computer

(fastest)(fastest) StateServer – session data stored in a state StateServer – session data stored in a state

service that can be locatedservice that can be locatedanywhere; ideal anywhere; ideal

for WebFarms for WebFarms (faster)(faster) SQLServer SQLServer – – session data stored in session data stored in

Microsoft Microsoft SQL Server™ SQL Server™ (fast)(fast)

Off Off – disable session state– disable session state Session state can be configured using Session state can be configured using

<sessionState> section<sessionState> section Can store COM components in session only in Can store COM components in session only in

InProcInProc Can store managed components in any session state Can store managed components in any session state

modesmodes

Page 20: Migration from ASP to ASP.NET

20

Security Related ChangesSecurity Related Changes The IIS part of the security remains sameThe IIS part of the security remains same New robust and flexible security model is based on New robust and flexible security model is based on

the security sections in the configuration filesthe security sections in the configuration files New authentication modesNew authentication modes

Windows: Windows: uses Windows Authenticationuses Windows Authentication Forms: Forms: uses cookie-based custom logon uses cookie-based custom logon

formsforms Passport: Passport: uses the Microsoft .NET Passport uses the Microsoft .NET Passport

ServiceService None: None: no authenticationno authentication

Authorization modes permit you to control access to Authorization modes permit you to control access to resources:resources: File authorization File authorization URL authorizationURL authorization Permit and deny users access to the applicationPermit and deny users access to the application

Page 21: Migration from ASP to ASP.NET

21

Migrating VBScript to Visual Migrating VBScript to Visual Basic .NETBasic .NET No VBScript in ASP.NET — it’s all Microsoft No VBScript in ASP.NET — it’s all Microsoft

Visual Basic® .NET!Visual Basic® .NET! Changing the file name extension to .aspx is the first Changing the file name extension to .aspx is the first

stepstep Visual Basic language changesVisual Basic language changes

Option Explicit is now the defaultOption Explicit is now the default No more “variant” type No more “variant” type —— use type “Object” use type “Object” Method and function calls with parameters now require Method and function calls with parameters now require

parenthesis, so change:parenthesis, so change:

<% Response.Write “Hi” %><% Response.Write “Hi” %> toto <% Response.Write (“Hi”) %><% Response.Write (“Hi”) %>

By default, arguments are passed by valueBy default, arguments are passed by value Arrays are now zero basedArrays are now zero based

Page 22: Migration from ASP to ASP.NET

22

Visual Basic Language ChangesVisual Basic Language Changes

Let and Set are not supported, so change:Let and Set are not supported, so change:

Set MyObj1 = MyObj2Set MyObj1 = MyObj2 toto MyObj1 = MyObj2MyObj1 = MyObj2

No more default properties (except for indexed No more default properties (except for indexed properties), so change:properties), so change:

MyString as string = Textbox1MyString as string = Textbox1 toto MyString as string = Textbox.TextMyString as string = Textbox.Text

Integer data type is now 32 bits and a Long data type Integer data type is now 32 bits and a Long data type is 64 bitsis 64 bits

Use structured error handling (try catch block) Use structured error handling (try catch block) instead of On Error (On Error still works)instead of On Error (On Error still works)

Must cast data types explicitly:Must cast data types explicitly:Response.Write (“Count=“ & CStr(MyCount))Response.Write (“Count=“ & CStr(MyCount))

oror Response.Write(“Count=“ & CType(MyCount, String))Response.Write(“Count=“ & CType(MyCount, String))

Page 23: Migration from ASP to ASP.NET

23

Visual Basic Language Changes Visual Basic Language Changes (2)(2)

Must have spaces around “&” while doing Must have spaces around “&” while doing string concatenation, so change:string concatenation, so change:

x = str1&str2x = str1&str2

to to x = str1 & str2x = str1 & str2

Property Get, Property Set, and Property Let Property Get, Property Set, and Property Let are not supported anymore, so instead use:are not supported anymore, so instead use:

Public Property MyCount as IntegerPublic Property MyCount as Integer

Get Get

MyCount = InternalValueMyCount = InternalValue

End GetEnd Get

Set Set

InternalValue = valueInternalValue = value

End SetEnd Set

End PropertyEnd Property

Page 24: Migration from ASP to ASP.NET

24

Migrating JScript to JScript .NETMigrating JScript to JScript .NET

Start by changing the file name extension to .aspxStart by changing the file name extension to .aspx Declare your variables explicitlyDeclare your variables explicitly Microsoft JScript® .NET language changesMicrosoft JScript® .NET language changes

You can now pass variables by referenceYou can now pass variables by reference ““expando” modifier available to extend user-defined objectsexpando” modifier available to extend user-defined objects Can use COM components directly from JScript .NETCan use COM components directly from JScript .NET Server Object’s methods are case sensitiveServer Object’s methods are case sensitive The Arguments object is not available The Arguments object is not available — — use a parameter use a parameter

array insteadarray instead Functions cannot be redefinedFunctions cannot be redefined For Large pages, move function/method code out of <% %> For Large pages, move function/method code out of <% %>

blocks to <Script runat=“server”> blocksblocks to <Script runat=“server”> blocks

Page 25: Migration from ASP to ASP.NET

25

Migrating Applications that Use Migrating Applications that Use COM ComponentsCOM Components COM related changes:COM related changes:

ASP.NET uses MTA instead of STAASP.NET uses MTA instead of STA Pages with STA components may or may not perform well Pages with STA components may or may not perform well Early binding is preferred in ASP.NETEarly binding is preferred in ASP.NET Cannot use ASPCOMPAT with WebServicesCannot use ASPCOMPAT with WebServices

COM InteropCOM Interop Can use all your former COM components in ASP.NET Can use all your former COM components in ASP.NET Use ASPCOMPAT keyword if you plan to use existing STA Use ASPCOMPAT keyword if you plan to use existing STA

components in ASP.NETcomponents in ASP.NET Use ASPCOMPAT only when using STA objects or when Use ASPCOMPAT only when using STA objects or when

your COM objects access ASP intrinsic objectsyour COM objects access ASP intrinsic objects

Page 26: Migration from ASP to ASP.NET

26

COM Objects Migration — FAQCOM Objects Migration — FAQ

What if the page contains both MTA and What if the page contains both MTA and STA?STA? Use ASPCOMPATUse ASPCOMPAT

What if I have a middle tier containing COM What if I have a middle tier containing COM objects?objects? Use horizontal or vertical migration strategiesUse horizontal or vertical migration strategies

What about the performance if I use existing What about the performance if I use existing COM objects?COM objects? Very little overhead if the method does Very little overhead if the method does

substantial taskssubstantial tasks Significant overhead if the method does not do Significant overhead if the method does not do

muchmuch

Page 27: Migration from ASP to ASP.NET

27

COM Objects Migration — FAQ COM Objects Migration — FAQ (2)(2)

What about deploying COM objects used in What about deploying COM objects used in ASPX pages?ASPX pages? If you want to use Server.CreateObject, then there If you want to use Server.CreateObject, then there

is no changeis no change If you use early binding then use the PIA (Primary If you use early binding then use the PIA (Primary

Interop Assembly) for the COM component and Interop Assembly) for the COM component and make sure you deploy the PIA on the target servermake sure you deploy the PIA on the target server

How can I use STA components from XML How can I use STA components from XML WebServices?WebServices? Register the component in COM+ and make sure Register the component in COM+ and make sure

you are running Windows 2000 SP2you are running Windows 2000 SP2

Page 28: Migration from ASP to ASP.NET

28

Migrating Applications that Use Migrating Applications that Use DatabasesDatabases Data access changesData access changes

ADO (through Interop) can be used, but Microsoft ADO (through Interop) can be used, but Microsoft does not recommend itdoes not recommend it

ADO and ADO.NET are quite differentADO and ADO.NET are quite different ADO.NET is not exactly backward compatibleADO.NET is not exactly backward compatible Three main objects in ADO.NET: DataSet, Three main objects in ADO.NET: DataSet,

DataReader, and DataAdapterDataReader, and DataAdapter Two built-in managed data providers: SQLClient Two built-in managed data providers: SQLClient

and OLEDBand OLEDB Built-in designer support for ADO.NET objects in Built-in designer support for ADO.NET objects in

Visual Studio .NETVisual Studio .NET

Page 29: Migration from ASP to ASP.NET

29

Migrating Applications that Use Migrating Applications that Use Databases Databases (2)(2)

StrategiesStrategies Rewrite ADO code in ADO.NET instead of Rewrite ADO code in ADO.NET instead of

migratingmigrating Keep ADO code as a short term approachKeep ADO code as a short term approach If you use ADO code in ASP pages, use Primary If you use ADO code in ASP pages, use Primary

Interop Assembly for ADO on both the developer Interop Assembly for ADO on both the developer box and the serverbox and the server

If you need read-only data, use a DataReaderIf you need read-only data, use a DataReader

Page 30: Migration from ASP to ASP.NET

30

Data Access Migration — FAQData Access Migration — FAQ

What if my application has straight ADO code What if my application has straight ADO code in ASP pages?in ASP pages? Use ASPCOMPAT to use the code as it is (may be Use ASPCOMPAT to use the code as it is (may be

slower)slower) Rewrite the data access code to use ADO.NETRewrite the data access code to use ADO.NET

What if my application has COM objects that What if my application has COM objects that use data access?use data access? Use the ASPCOMPAT attribute (if component Use the ASPCOMPAT attribute (if component

uses STA)uses STA) What if my database has no managed What if my database has no managed

providers?providers? You can use OLEDB providers in ADO.NETYou can use OLEDB providers in ADO.NET If there are no OLEDB providers, use ODBC If there are no OLEDB providers, use ODBC

managed providermanaged provider

Page 31: Migration from ASP to ASP.NET

31

Data Access migration — FAQ Data Access migration — FAQ (2)(2)

What if I have a data access tier?What if I have a data access tier? Make these objects call Web Services or managed Make these objects call Web Services or managed

componentscomponents Later on, modify the presentation layer to use Later on, modify the presentation layer to use

only .NET middle tieronly .NET middle tier

Do I have to package ADO Components Do I have to package ADO Components during deployment?during deployment? Make sure your server has MDAC 2.6 installedMake sure your server has MDAC 2.6 installed Make sure you also deploy the PIA for ADODB on Make sure you also deploy the PIA for ADODB on

the serverthe server

Page 32: Migration from ASP to ASP.NET

32

General Migration StrategyGeneral Migration Strategy Identify the parts of the application that you Identify the parts of the application that you

have to migratehave to migrate Plan very carefully and try to have minimal Plan very carefully and try to have minimal

impact on the existing application during the impact on the existing application during the migrationmigration

In a multi-tier scenario, take the horizontal or In a multi-tier scenario, take the horizontal or vertical approachvertical approach Horizontal Horizontal – – migrate the whole tier migrate the whole tier

(middle/presentation) at the same (middle/presentation) at the same timetime

Vertical Vertical – – migrate some pages, some migrate some pages, some components, at components, at

the same timethe same time

Decide if you want to reuse existing COM Decide if you want to reuse existing COM componentscomponents

Page 33: Migration from ASP to ASP.NET

33

General Migration Strategy General Migration Strategy (2)(2)

Decide if you want to keep current ADO code Decide if you want to keep current ADO code for a whilefor a while

Rename the file name extension from .asp Rename the file name extension from .asp to .aspx to .aspx

Make the language-specific changes firstMake the language-specific changes first Make COM- and database-specific changesMake COM- and database-specific changes Test, test, testTest, test, test

Page 34: Migration from ASP to ASP.NET

34

Migration Best PracticesMigration Best Practices General General

If the application is relatively small, consider If the application is relatively small, consider rewritingrewriting

If the application is very large, then plan carefully If the application is very large, then plan carefully and migrate part by partand migrate part by part

If you only want to make a syntactic port, then If you only want to make a syntactic port, then consider only ASPX pages (that is, not using the consider only ASPX pages (that is, not using the “code behind” model) and do not make “code behind” model) and do not make unnecessary changesunnecessary changes

You do not have to port the whole site at the You do not have to port the whole site at the same timesame time Consider migrating the slow/critical partsConsider migrating the slow/critical parts Remember, you can run ASP and ASP.NET side-by-sideRemember, you can run ASP and ASP.NET side-by-side

Try to migrate the read-only pages firstTry to migrate the read-only pages first Write automated tools to do some tasksWrite automated tools to do some tasks

Page 35: Migration from ASP to ASP.NET

35

Migration Best Practices Migration Best Practices (2)(2)

Language relatedLanguage related Strongly type all the variablesStrongly type all the variables If possible, convert all the On Error statements to If possible, convert all the On Error statements to

try catch blockstry catch blocks Remember that they may not be as easy as Remember that they may not be as easy as

they lookthey look Convert Include files into assemblies or user Convert Include files into assemblies or user

controls (.ascx)controls (.ascx) Use call keyword for function calls and use Use call keyword for function calls and use

parenthesis for function and subroutine callsparenthesis for function and subroutine calls Identify default properties and replace them Identify default properties and replace them

appropriatelyappropriately Always use Option ExplicitAlways use Option Explicit

Page 36: Migration from ASP to ASP.NET

36

Migration Best Practices Migration Best Practices (3)(3)

Data access relatedData access related If you have a data access tier, move it into .NETIf you have a data access tier, move it into .NET

COM relatedCOM related Always use early bindingAlways use early binding Explicitly free resources from codeExplicitly free resources from code

Project management relatedProject management related Keep two code trees while migrating, and make Keep two code trees while migrating, and make

sure to update both of them while adding changes sure to update both of them while adding changes to the existing Web siteto the existing Web site

First try to modify the existing code as it isFirst try to modify the existing code as it is After you complete this, try to modify the After you complete this, try to modify the

application to use the advantages provided application to use the advantages provided by .NETby .NET

Page 37: Migration from ASP to ASP.NET

37

Migration Best Practices Migration Best Practices (4)(4)

Testing relatedTesting related Update existing links to your Web site/pages Update existing links to your Web site/pages

because the file name extension is now .aspxbecause the file name extension is now .aspx Use a link checker to check any broken links, Use a link checker to check any broken links,

images, paths, and so onimages, paths, and so on Test very wellTest very well

Page 38: Migration from ASP to ASP.NET

38

ASP to ASP.NET Compatibility — ASP to ASP.NET Compatibility — FAQFAQ How can ASP and ASP.NET co-exist?How can ASP and ASP.NET co-exist?

Because they have different file name extensions Because they have different file name extensions (.asp and .aspx)(.asp and .aspx)

Because they have different application settings Because they have different application settings (registry and config files)(registry and config files)

Can they share session and application data? Can they share session and application data? No No – w– write custom code or use third-party rite custom code or use third-party

componentcomponent

What about Global.asa in ASP.NET? What about Global.asa in ASP.NET? In ASP.NET, it is called as Global.asaxIn ASP.NET, it is called as Global.asax

Page 39: Migration from ASP to ASP.NET

39

ASP to ASP.NET Compatibility — ASP to ASP.NET Compatibility — FAQ FAQ (2)(2)

Can I use .NET components from ASP, and Can I use .NET components from ASP, and COM components from ASP.NET?COM components from ASP.NET? Yes Yes – – use CCW to call managed components from use CCW to call managed components from

ASPASP Yes Yes – u– use RCW to call COM components from se RCW to call COM components from

ASP.NETASP.NET What about the anonymous account in What about the anonymous account in

ASP.NET? ASP.NET? Remains the sameRemains the same

What about the hosting process in ASP.NET? What about the hosting process in ASP.NET? ASP.NET applications run under ASP.NET applications run under

ASPNET_WP.EXEASPNET_WP.EXE By default, ASP.NET worker process runs under By default, ASP.NET worker process runs under

an account called ASPNETan account called ASPNET

Page 40: Migration from ASP to ASP.NET

40

ASP to ASP.NET Compatibility — ASP to ASP.NET Compatibility — FAQ FAQ (3)(3)

Do I need to write code for different Do I need to write code for different browsers? browsers? No No – – ASP.NET produces HTML 3.2 compliant ASP.NET produces HTML 3.2 compliant

outputoutput

Can I still use ADO from ASP.NET? Can I still use ADO from ASP.NET? Yes Yes – y– you can use ADO through Interop, but ou can use ADO through Interop, but

ADO.NET is preferredADO.NET is preferred

What about Include files? What about Include files? Can be used, but better to convert them to class Can be used, but better to convert them to class

libraries or user controls (.ascx) insteadlibraries or user controls (.ascx) instead

Can I call ASP pages from ASPX and vice Can I call ASP pages from ASPX and vice versa? versa? YesYes

Page 42: Migration from ASP to ASP.NET

42

Migration ResourcesMigration Resources

Migrating to ASP.NET: Key Considerations Migrating ASP Pages to ASP.NETMigrating ASP Pages to ASP.NET Converting ASP to ASP.NETConverting ASP to ASP.NET Upgrading to Microsoft .NET on GotDotNetUpgrading to Microsoft .NET on GotDotNet Upgrading to .NET on MSDNUpgrading to .NET on MSDN Upgrading from JScript to JScript .NETUpgrading from JScript to JScript .NET Microsoft .NET/COM Migration and Microsoft .NET/COM Migration and

InteroperabilityInteroperability Q314775, “INFO: Migrating Visual InterDev Q314775, “INFO: Migrating Visual InterDev

Design-Time Controls to ASP.NET”Design-Time Controls to ASP.NET” .NET Migration Case Study.NET Migration Case Study

Page 43: Migration from ASP to ASP.NET

43

Thank you for joining us for today’s Microsoft SupportThank you for joining us for today’s Microsoft SupportWebCast.WebCast.

For information about all upcoming Support WebCasts For information about all upcoming Support WebCasts and access to the archived content (streaming mediaand access to the archived content (streaming mediafiles, PowerPoint® slides, and transcripts), please visit: files, PowerPoint® slides, and transcripts), please visit: http://support.microsoft.com/webcasts/http://support.microsoft.com/webcasts/

We sincerely appreciate your feedback. Please send any We sincerely appreciate your feedback. Please send any comments or suggestions regarding the Support comments or suggestions regarding the Support WebCasts to [email protected]. WebCasts to [email protected].