SlideShare a Scribd company logo
Migration from ASP to ASP.NET Anand M. Hegde Developer Support Engineer  Microsoft Developer Support  Microsoft Corporation
Overview Why should you migrate?  Introduction to Microsoft® ASP.NET Key changes from ASP to ASP.NET Migrating from ASP to ASP.NET Migrating applications that use COM components Migrating applications that use databases Migration best practices ASP to ASP.NET compatibility FAQ Resources for ASP.NET and migration
Why Should You Migrate? Increased scalability and reliability Minimum 2X to 3X performance gain Built-in cross-browser compatibility Rich server-side controls, Microsoft  Visual Studio® .NET designer support, and configuration options X-copy deployment of pages and components Better debugger; tracing options Content-code separation Take advantage of new caching features Enhanced state-management features ASP and ASP.NET can run side-by-side if required Many new features
Before You Migrate Get a good understanding of ASP.NET Know the changes from ASP to ASP.NET  Understand that migration requires code changes Although ASP.NET has excellent backward compatibility, migration may not be as easy as it seems in many cases
Introduction to ASP.NET ASP.NET is: A new programming framework for Web applications An overhaul of ASP A part of Microsoft .NET Compiled and event driven programming model It permits you to: Rapidly develop powerful Web applications and services Easily build, deploy, and run Web applications that can target any browser or device  It requires: Microsoft Windows® 2000 or later for hosting and development
ASP.NET Architecture
ASP.NET Request Flow ASPX engine Gen’d page class file Page class ASPX file Request Parse Generate Instantiate, process, and render Response Request Code behind class file Response Instantiate
ASP.NET Page Life Cycle ASP.NET pages are event based  Event flow in ASPX pages Page_Init: the page and controls are initialized  Page_Load: all the controls and page are loaded Change events for controls are processed Click events for controls are processed Page_PreRender: page is about to render Page_Unload: page is unloaded from memory
ASP Programming Models Two types of programming models exist ASPX page only: contains HTML, control tags, and code Code behind model: ASPX file contains HTML and control tags, and  a “code behind” file contains code  A true separation between code and content One File Two files. (“code behind” model) Page.aspx Page.aspx Page.aspx.vb <Tags> +  Code <Tags> Code
ASP.NET Features Life made easy for developers Excellent backward compatibility with classic ASP Visual Studio designer support, rich server controls, and base class library support Write code in the language of your choice Call Microsoft Win32® APIs directly Structured error handling Great debugging and tracing support
ASP.NET Features  (2) Performance, scalability, and reliability Compiled code means speed Cache APIs to improve performance and scalability Built-in support for WebFarms and WebGardens Nonstop availability and protection against deadlocks, memory leaks, and so on
ASP.NET Features  (3) Easy deployment X-copy deployment  Dynamic updates without interrupting the service No more registry!  — u se XML-based configuration files New application models Develop mobile Internet applications with ease Built-in support to use XML WebServices More control with the new security model Flexible session state management Many other new features
Core Object Changes Request object changes: Request(item) ,  Request.QueryString(item) ,  and  Request.Form(item)  now return a name value collection In classic ASP, they return an array of strings Use Response.Write with caution It will output results at the top of the page before the <HTML> tag  Instead: Use server controls (placeholder) Use <% %> tags if you want the output to appear in the right place Each of the core objects now have many new properties and methods.  There are some new objects available For example: cache, user and trace
Structural Changes One page – one language No mixing of languages in single page A page can have only one server-side Form tag and it must submit to the same page An ASPX page may contain: Directives:  <%@ Directive %>   Server controls:  <tag runat=server> Code blocks:  <script runat=server> Data binding expressions:  <%#  %> Server-side comments:  <%-- --%> Server-side includes:  <!-- #include --> Render code:  <%=  %> and <%  %>
Structural Changes  (2) Code block – related changes You cannot declare functions inside <% %> tags Declare all your functions and variables inside the server-side <SCRIPT> blocks <Script runat=“server” language=“vb”> dim gVar as String ‘Page level variable private sub MySubRoutine() Label1.Text = gVar End Sub </Script >
Structural Changes  (3) No Render functions permited Change: <% MyRenderFunction Sub MyRenderFunction() %> <h1> Hi there! </h1> <%end  sub%> To: <% Call MyRenderFunction()%> <script runat=“server” language=“vb”>   Response.Write(“Hi there!”) </script>
Structural Changes  (4) New page directives In ASP, directives had to be at the top of the page, but you do not have to do this anymore You can now have multiple directives on the same page Sample page directive:  <%@ Page Language=&quot;VB&quot; ContentType=&quot;text/xml&quot; %>   See the  documents on new page directives
Application Configuration Changes ASP.NET application settings are stored in XML configuration files Types of configuration files Machine.config  Contains machine-wide settings  Web.Config Contains project/application-wide settings Easy programmatic access to the data in these files Some of the settings in the IIS snap-in are ignored For example: application protection level, session state
Session Management Changes New session state storage mechanisms InProc  –  session data stored on local  computer  (fastest) StateServer – session data stored in a state  service that can be located anywhere; ideal for WebFarms  (faster) SQLServer  –  session data stored in Microsoft  SQL Server™  (fast)   Off  – disable session state Session state can be configured using <sessionState> section Can store COM components in session only in InProc Can store managed components in any session state modes
Security Related Changes The IIS part of the security remains same New robust and flexible security model is based on the security sections in the configuration files New authentication modes Windows:  uses Windows Authentication Forms:  uses cookie-based custom logon forms Passport:  uses the Microsoft .NET Passport Service None:  no authentication Authorization modes permit you to control access to resources: File authorization  URL authorization Permit and deny users access to the application
Migrating VBScript to Visual Basic .NET No VBScript in ASP.NET — it’s all Microsoft  Visual Basic® .NET! Changing the file name extension to .aspx is the first step Visual Basic language changes Option Explicit is now the default No more “variant” type  —  use type “Object” Method and function calls with parameters now require parenthesis, so change: <% Response.Write “Hi” %>   to <% Response.Write (“Hi”) %> By default, arguments are passed by value Arrays are now zero based
Visual Basic Language Changes Let and Set are not supported, so change: Set MyObj1 = MyObj2   to   MyObj1 = MyObj2   No more default properties (except for indexed properties), so change: MyString as string = Textbox1   to MyString as string = Textbox.Text Integer data type is now 32 bits and a Long data type is 64 bits Use structured error handling (try catch block) instead of On Error (On Error still works) Must cast data types explicitly: Response.Write (“Count=“ & CStr(MyCount))   or Response.Write(“Count=“ & CType(MyCount, String))
Visual Basic Language Changes  (2) Must have spaces around “&” while doing string concatenation, so change:   x = str1&str2   to  x = str1 & str2 Property Get, Property Set, and Property Let are not supported anymore, so instead use: Public Property MyCount as Integer   Get    MyCount = InternalValue End Get Set  InternalValue = value End Set End Property
Migrating JScript to JScript .NET Start by changing the file name extension to .aspx Declare your variables explicitly Microsoft JScript® .NET language changes You can now pass variables by reference “ expando” modifier available to extend user-defined objects Can use COM components directly from JScript .NET Server Object’s methods are case sensitive The Arguments object is not available  —  use a parameter array instead Functions cannot be redefined For Large pages, move function/method code out of <% %> blocks to <Script runat=“server”> blocks
Migrating Applications that Use COM Components COM related changes: ASP.NET uses MTA instead of STA Pages with STA components may or may not perform well  Early binding is preferred in ASP.NET Cannot use ASPCOMPAT with WebServices COM Interop Can use all your former COM components in ASP.NET  Use ASPCOMPAT keyword if you plan to use existing STA components in ASP.NET Use ASPCOMPAT only when using STA objects or when your COM objects access ASP intrinsic objects
COM Objects Migration — FAQ What if the page contains both MTA and STA? Use ASPCOMPAT What if I have a middle tier containing COM objects? Use horizontal or vertical migration strategies What about the performance if I use existing COM objects? Very little overhead if the method does substantial tasks Significant overhead if the method does not do much
COM Objects Migration — FAQ  (2) What about deploying COM objects used in ASPX pages? If you want to use Server.CreateObject, then there is no change If you use early binding then use the PIA (Primary Interop Assembly) for the COM component and make sure you deploy the PIA on the target server How can I use STA components from XML WebServices? Register the component in COM+ and make sure you are running Windows 2000 SP2
Migrating Applications that Use Databases Data access changes ADO (through Interop) can be used, but Microsoft does not recommend it ADO and ADO.NET are quite different ADO.NET is not exactly backward compatible Three main objects in ADO.NET: DataSet, DataReader, and DataAdapter Two built-in managed data providers: SQLClient and OLEDB Built-in designer support for ADO.NET objects in Visual Studio .NET
Migrating Applications that Use Databases  (2) Strategies Rewrite ADO code in ADO.NET instead of migrating Keep ADO code as a short term approach If you use ADO code in ASP pages, use Primary Interop Assembly for ADO on both the developer box and the server If you need read-only data, use a DataReader
Data Access Migration — FAQ What if my application has straight ADO code in ASP pages? Use ASPCOMPAT to use the code as it is (may be slower) Rewrite the data access code to use ADO.NET What if my application has COM objects that use data access? Use the ASPCOMPAT attribute (if component uses STA) What if my database has no managed providers? You can use OLEDB providers in ADO.NET If there are no OLEDB providers, use ODBC managed provider
Data Access migration — FAQ  (2) What if I have a data access tier? Make these objects call Web Services or managed components Later on, modify the presentation layer to use only .NET middle tier Do I have to package ADO Components during deployment? Make sure your server has MDAC 2.6 installed Make sure you also deploy the PIA for ADODB on the server
General Migration Strategy Identify the parts of the application that you have to migrate Plan very carefully and try to have minimal impact on the existing application during the migration In a multi-tier scenario, take the horizontal or vertical approach Horizontal  –  migrate the whole tier  (middle/presentation) at the same  time Vertical  –  migrate some pages, some  components, at the same time Decide if you want to reuse existing COM components
General Migration Strategy  (2) Decide if you want to keep current ADO code for a while Rename the file name extension from .asp to .aspx  Make the language-specific changes first Make COM- and database-specific changes Test, test, test
Migration Best Practices General  If the application is relatively small, consider rewriting If the application is very large, then plan carefully and migrate part by part If you only want to make a syntactic port, then consider only ASPX pages (that is, not using the “code behind” model) and do not make unnecessary changes You do not have to port the whole site at the same time Consider migrating the slow/critical parts Remember, you can run ASP and ASP.NET side-by-side Try to migrate the read-only pages first Write automated tools to do some tasks
Migration Best Practices  (2) Language related Strongly type all the variables If possible, convert all the On Error statements to try catch blocks Remember that they may not be as easy as they look Convert Include files into assemblies or user controls (.ascx) Use call keyword for function calls and use parenthesis for function and subroutine calls Identify default properties and replace them appropriately Always use Option Explicit
Migration Best Practices  (3) Data access related If you have a data access tier, move it into .NET COM related Always use early binding Explicitly free resources from code Project management related Keep two code trees while migrating, and make sure to update both of them while adding changes to the existing Web site First try to modify the existing code as it is After you complete this, try to modify the application to use the advantages provided by .NET
Migration Best Practices  (4) Testing related Update existing links to your Web site/pages because the file name extension is now .aspx Use a link checker to check any broken links, images, paths, and so on Test very well
ASP to ASP.NET Compatibility — FAQ How can ASP and ASP.NET co-exist? Because they have different file name extensions  (.asp and .aspx) Because they have different application settings (registry and config files) Can they share session and application data?  No  – w rite custom code or use third-party component What about Global.asa in ASP.NET?  In ASP.NET, it is called as Global.asax
ASP to ASP.NET Compatibility — FAQ  (2) Can I use .NET components from ASP, and COM components from ASP.NET? Yes  –  use CCW to call managed components from ASP Yes  – u se RCW to call COM components from ASP.NET What about the anonymous account in ASP.NET?  Remains the same What about the hosting process in ASP.NET?  ASP.NET applications run under ASPNET_WP.EXE By default, ASP.NET worker process runs under an account called ASPNET
ASP to ASP.NET Compatibility — FAQ  (3) Do I need to write code for different browsers?  No  –  ASP.NET produces HTML 3.2 compliant output Can I still use ADO from ASP.NET?  Yes  – y ou can use ADO through Interop, but ADO.NET is preferred What about Include files?  Can be used, but better to convert them to class libraries or user controls (.ascx) instead Can I call ASP pages from ASPX and vice versa?  Yes
ASP.NET Resources ASP.NET Quick Start Tutorials Authentication in ASP.NET Security ASP.NET Security Session State in ASP.NET ASP.NET Configuration http://www.gotdotnet.com   http://www.asp.net http://www.ibuyspy.com
Migration Resources Migrating to ASP.NET: Key Considerations Migrating ASP Pages to ASP.NET Converting ASP to ASP.NET Upgrading to Microsoft .NET on GotDotNet Upgrading to .NET on MSDN Upgrading from JScript to JScript .NET Microsoft .NET/COM Migration and Interoperability Q314775 , “INFO: Migrating Visual InterDev Design-Time Controls to ASP.NET” .NET Migration Case Study
Thank you for joining us for today’s Microsoft Support WebCast. For information about all upcoming Support WebCasts  and access to the archived content (streaming media files, PowerPoint® slides, and transcripts), please visit:  http://support.microsoft.com/webcasts/ We sincerely appreciate your feedback. Please send any  comments or suggestions regarding the Support  WebCasts to  [email_address] .
Ad

More Related Content

What's hot (20)

Microsoft SharePoint Services ppt
Microsoft SharePoint Services pptMicrosoft SharePoint Services ppt
Microsoft SharePoint Services ppt
sarahjohnson621
 
Data power use cases
Data power use casesData power use cases
Data power use cases
sflynn073
 
Code review
Code reviewCode review
Code review
dqpi
 
API Management in Azure
API Management in AzureAPI Management in Azure
API Management in Azure
Tomasso Groenendijk
 
SharePoint Server 2016 ハイブリッド検索やってみた
SharePoint Server 2016 ハイブリッド検索やってみたSharePoint Server 2016 ハイブリッド検索やってみた
SharePoint Server 2016 ハイブリッド検索やってみた
Hirofumi Ota
 
Api gateway in microservices
Api gateway in microservicesApi gateway in microservices
Api gateway in microservices
Kunal Hire
 
Github Copilot vs Amazon CodeWhisperer for Java developers at JCON 2023
Github Copilot vs Amazon CodeWhisperer for Java developers at JCON 2023Github Copilot vs Amazon CodeWhisperer for Java developers at JCON 2023
Github Copilot vs Amazon CodeWhisperer for Java developers at JCON 2023
Vadym Kazulkin
 
Tech Talk #5 : Code Analysis SonarQube - Lương Trọng Nghĩa
Tech Talk #5 : Code Analysis SonarQube - Lương Trọng NghĩaTech Talk #5 : Code Analysis SonarQube - Lương Trọng Nghĩa
Tech Talk #5 : Code Analysis SonarQube - Lương Trọng Nghĩa
Nexus FrontierTech
 
Introduction to Robot Framework – Exove
Introduction to Robot Framework – ExoveIntroduction to Robot Framework – Exove
Introduction to Robot Framework – Exove
Exove
 
Amazon S3による静的Webサイトホスティング
Amazon S3による静的WebサイトホスティングAmazon S3による静的Webサイトホスティング
Amazon S3による静的Webサイトホスティング
Yasuhiro Horiuchi
 
Mocking APIs Collaboratively with Postman
Mocking APIs Collaboratively with PostmanMocking APIs Collaboratively with Postman
Mocking APIs Collaboratively with Postman
Nordic APIs
 
デバイスの運用で使える AWS IoTサービスの紹介
デバイスの運用で使える AWS IoTサービスの紹介デバイスの運用で使える AWS IoTサービスの紹介
デバイスの運用で使える AWS IoTサービスの紹介
Amazon Web Services Japan
 
Effective code reviews
Effective code reviewsEffective code reviews
Effective code reviews
Sebastian Marek
 
Code Quality Lightning Talk
Code Quality Lightning TalkCode Quality Lightning Talk
Code Quality Lightning Talk
Jonathan Gregory
 
Code Review Best Practices
Code Review Best PracticesCode Review Best Practices
Code Review Best Practices
Trisha Gee
 
Cybersecurity and Generative AI - for Good and Bad vol.2
Cybersecurity and Generative AI - for Good and Bad vol.2Cybersecurity and Generative AI - for Good and Bad vol.2
Cybersecurity and Generative AI - for Good and Bad vol.2
Ivo Andreev
 
Debugging Microservices - QCON 2017
Debugging Microservices - QCON 2017Debugging Microservices - QCON 2017
Debugging Microservices - QCON 2017
Idit Levine
 
Understand the SharePoint Basics
Understand the SharePoint BasicsUnderstand the SharePoint Basics
Understand the SharePoint Basics
Benjamin Niaulin
 
Introdução a testes de software utilizando selenium
Introdução a testes de software utilizando seleniumIntrodução a testes de software utilizando selenium
Introdução a testes de software utilizando selenium
Sandy Maciel
 
MongoDB 이해하기
MongoDB 이해하기MongoDB 이해하기
MongoDB 이해하기
선협 이
 
Microsoft SharePoint Services ppt
Microsoft SharePoint Services pptMicrosoft SharePoint Services ppt
Microsoft SharePoint Services ppt
sarahjohnson621
 
Data power use cases
Data power use casesData power use cases
Data power use cases
sflynn073
 
Code review
Code reviewCode review
Code review
dqpi
 
SharePoint Server 2016 ハイブリッド検索やってみた
SharePoint Server 2016 ハイブリッド検索やってみたSharePoint Server 2016 ハイブリッド検索やってみた
SharePoint Server 2016 ハイブリッド検索やってみた
Hirofumi Ota
 
Api gateway in microservices
Api gateway in microservicesApi gateway in microservices
Api gateway in microservices
Kunal Hire
 
Github Copilot vs Amazon CodeWhisperer for Java developers at JCON 2023
Github Copilot vs Amazon CodeWhisperer for Java developers at JCON 2023Github Copilot vs Amazon CodeWhisperer for Java developers at JCON 2023
Github Copilot vs Amazon CodeWhisperer for Java developers at JCON 2023
Vadym Kazulkin
 
Tech Talk #5 : Code Analysis SonarQube - Lương Trọng Nghĩa
Tech Talk #5 : Code Analysis SonarQube - Lương Trọng NghĩaTech Talk #5 : Code Analysis SonarQube - Lương Trọng Nghĩa
Tech Talk #5 : Code Analysis SonarQube - Lương Trọng Nghĩa
Nexus FrontierTech
 
Introduction to Robot Framework – Exove
Introduction to Robot Framework – ExoveIntroduction to Robot Framework – Exove
Introduction to Robot Framework – Exove
Exove
 
Amazon S3による静的Webサイトホスティング
Amazon S3による静的WebサイトホスティングAmazon S3による静的Webサイトホスティング
Amazon S3による静的Webサイトホスティング
Yasuhiro Horiuchi
 
Mocking APIs Collaboratively with Postman
Mocking APIs Collaboratively with PostmanMocking APIs Collaboratively with Postman
Mocking APIs Collaboratively with Postman
Nordic APIs
 
デバイスの運用で使える AWS IoTサービスの紹介
デバイスの運用で使える AWS IoTサービスの紹介デバイスの運用で使える AWS IoTサービスの紹介
デバイスの運用で使える AWS IoTサービスの紹介
Amazon Web Services Japan
 
Code Quality Lightning Talk
Code Quality Lightning TalkCode Quality Lightning Talk
Code Quality Lightning Talk
Jonathan Gregory
 
Code Review Best Practices
Code Review Best PracticesCode Review Best Practices
Code Review Best Practices
Trisha Gee
 
Cybersecurity and Generative AI - for Good and Bad vol.2
Cybersecurity and Generative AI - for Good and Bad vol.2Cybersecurity and Generative AI - for Good and Bad vol.2
Cybersecurity and Generative AI - for Good and Bad vol.2
Ivo Andreev
 
Debugging Microservices - QCON 2017
Debugging Microservices - QCON 2017Debugging Microservices - QCON 2017
Debugging Microservices - QCON 2017
Idit Levine
 
Understand the SharePoint Basics
Understand the SharePoint BasicsUnderstand the SharePoint Basics
Understand the SharePoint Basics
Benjamin Niaulin
 
Introdução a testes de software utilizando selenium
Introdução a testes de software utilizando seleniumIntrodução a testes de software utilizando selenium
Introdução a testes de software utilizando selenium
Sandy Maciel
 
MongoDB 이해하기
MongoDB 이해하기MongoDB 이해하기
MongoDB 이해하기
선협 이
 

Viewers also liked (16)

Saas, ASP og Cloud aftaler
Saas, ASP og Cloud aftalerSaas, ASP og Cloud aftaler
Saas, ASP og Cloud aftaler
Peter Lind Nielsen
 
ASP.NET Web Stack
ASP.NET Web StackASP.NET Web Stack
ASP.NET Web Stack
Ugo Lattanzi
 
Microsoft .NET Development Platform Internationalization
Microsoft .NET Development Platform InternationalizationMicrosoft .NET Development Platform Internationalization
Microsoft .NET Development Platform Internationalization
Rishi Kothari
 
Single page applications mit asp.net mvc und der asp.net web api
Single page applications mit asp.net mvc und der asp.net web apiSingle page applications mit asp.net mvc und der asp.net web api
Single page applications mit asp.net mvc und der asp.net web api
Alexander Zeitler
 
Mvc webforms
Mvc webformsMvc webforms
Mvc webforms
Muhammad Younis
 
CC 2015 Single Page Applications for the ASPNET Developer
CC 2015   Single Page Applications for the ASPNET DeveloperCC 2015   Single Page Applications for the ASPNET Developer
CC 2015 Single Page Applications for the ASPNET Developer
Allen Conway
 
ASP.NET 4.5 webforms
ASP.NET 4.5 webformsASP.NET 4.5 webforms
ASP.NET 4.5 webforms
Abhishek Sur
 
Asp.net
Asp.netAsp.net
Asp.net
OpenSource Technologies Pvt. Ltd.
 
Single Page Applications on JavaScript and ASP.NET MVC4
Single Page Applications on JavaScript and ASP.NET MVC4Single Page Applications on JavaScript and ASP.NET MVC4
Single Page Applications on JavaScript and ASP.NET MVC4
Yuriy Shapovalov
 
ASP.NET MVC for Begineers
ASP.NET MVC for BegineersASP.NET MVC for Begineers
ASP.NET MVC for Begineers
Shravan Kumar Kasagoni
 
Introduction ASP
Introduction ASPIntroduction ASP
Introduction ASP
FaTin GhaZmi
 
Asp Architecture
Asp ArchitectureAsp Architecture
Asp Architecture
Om Vikram Thapa
 
ASP.NET Presentation
ASP.NET PresentationASP.NET Presentation
ASP.NET Presentation
dimuthu22
 
Asp.net architecture
Asp.net architectureAsp.net architecture
Asp.net architecture
Iblesoft
 
Programming languages asp.net
Programming languages asp.netProgramming languages asp.net
Programming languages asp.net
Vasilios Kuznos
 
Formation joomla 1ere_session
Formation joomla 1ere_sessionFormation joomla 1ere_session
Formation joomla 1ere_session
Ahmed Seye
 
Microsoft .NET Development Platform Internationalization
Microsoft .NET Development Platform InternationalizationMicrosoft .NET Development Platform Internationalization
Microsoft .NET Development Platform Internationalization
Rishi Kothari
 
Single page applications mit asp.net mvc und der asp.net web api
Single page applications mit asp.net mvc und der asp.net web apiSingle page applications mit asp.net mvc und der asp.net web api
Single page applications mit asp.net mvc und der asp.net web api
Alexander Zeitler
 
CC 2015 Single Page Applications for the ASPNET Developer
CC 2015   Single Page Applications for the ASPNET DeveloperCC 2015   Single Page Applications for the ASPNET Developer
CC 2015 Single Page Applications for the ASPNET Developer
Allen Conway
 
ASP.NET 4.5 webforms
ASP.NET 4.5 webformsASP.NET 4.5 webforms
ASP.NET 4.5 webforms
Abhishek Sur
 
Single Page Applications on JavaScript and ASP.NET MVC4
Single Page Applications on JavaScript and ASP.NET MVC4Single Page Applications on JavaScript and ASP.NET MVC4
Single Page Applications on JavaScript and ASP.NET MVC4
Yuriy Shapovalov
 
ASP.NET Presentation
ASP.NET PresentationASP.NET Presentation
ASP.NET Presentation
dimuthu22
 
Asp.net architecture
Asp.net architectureAsp.net architecture
Asp.net architecture
Iblesoft
 
Programming languages asp.net
Programming languages asp.netProgramming languages asp.net
Programming languages asp.net
Vasilios Kuznos
 
Formation joomla 1ere_session
Formation joomla 1ere_sessionFormation joomla 1ere_session
Formation joomla 1ere_session
Ahmed Seye
 
Ad

Similar to Migration from ASP to ASP.NET (20)

Intro To Asp Net And Web Forms
Intro To Asp Net And Web FormsIntro To Asp Net And Web Forms
Intro To Asp Net And Web Forms
SAMIR BHOGAYTA
 
PPT
PPTPPT
PPT
webhostingguy
 
Asp dot net long
Asp dot net longAsp dot net long
Asp dot net long
Amelina Ahmeti
 
How to develop asp web applications
How to develop asp web applicationsHow to develop asp web applications
How to develop asp web applications
Deepankar Pathak
 
Migrating To Visual Studio 2008 & .Net Framework 3.5
Migrating To Visual Studio 2008 & .Net Framework 3.5Migrating To Visual Studio 2008 & .Net Framework 3.5
Migrating To Visual Studio 2008 & .Net Framework 3.5
Jeff Blankenburg
 
Developing an ASP.NET Web Application
Developing an ASP.NET Web ApplicationDeveloping an ASP.NET Web Application
Developing an ASP.NET Web Application
Rishi Kothari
 
Migrating To Visual Studio 2008 & .Net Framework 3.5
Migrating To Visual Studio 2008 & .Net Framework 3.5Migrating To Visual Studio 2008 & .Net Framework 3.5
Migrating To Visual Studio 2008 & .Net Framework 3.5
Clint Edmonson
 
Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net mvc
Phuc Le Cong
 
Asp.Net 2.0 Presentation
Asp.Net 2.0 PresentationAsp.Net 2.0 Presentation
Asp.Net 2.0 Presentation
sasidhar
 
Introductionto asp net-ppt
Introductionto asp net-pptIntroductionto asp net-ppt
Introductionto asp net-ppt
tmasyam
 
Walther Ajax4
Walther Ajax4Walther Ajax4
Walther Ajax4
rsnarayanan
 
Super billing asp.net
Super billing   asp.netSuper billing   asp.net
Super billing asp.net
superb11b
 
Walther Aspnet4
Walther Aspnet4Walther Aspnet4
Walther Aspnet4
rsnarayanan
 
Usability AJAX and other ASP.NET Features
Usability AJAX and other ASP.NET FeaturesUsability AJAX and other ASP.NET Features
Usability AJAX and other ASP.NET Features
Peter Gfader
 
DevNext - Web Programming Concepts Using Asp Net
DevNext - Web Programming Concepts Using Asp NetDevNext - Web Programming Concepts Using Asp Net
DevNext - Web Programming Concepts Using Asp Net
Adil Mughal
 
Overview of ASP.Net by software outsourcing company india
Overview of ASP.Net by software outsourcing company indiaOverview of ASP.Net by software outsourcing company india
Overview of ASP.Net by software outsourcing company india
Jignesh Aakoliya
 
ASP.NET MVC introduction
ASP.NET MVC introductionASP.NET MVC introduction
ASP.NET MVC introduction
Tomi Juhola
 
PPT on javascript ajax and css and some points related to server
PPT on javascript ajax and css and some points related to serverPPT on javascript ajax and css and some points related to server
PPT on javascript ajax and css and some points related to server
shivanichourasia01
 
Asp.netrole
Asp.netroleAsp.netrole
Asp.netrole
mani bhushan
 
ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008
Caleb Jenkins
 
Intro To Asp Net And Web Forms
Intro To Asp Net And Web FormsIntro To Asp Net And Web Forms
Intro To Asp Net And Web Forms
SAMIR BHOGAYTA
 
How to develop asp web applications
How to develop asp web applicationsHow to develop asp web applications
How to develop asp web applications
Deepankar Pathak
 
Migrating To Visual Studio 2008 & .Net Framework 3.5
Migrating To Visual Studio 2008 & .Net Framework 3.5Migrating To Visual Studio 2008 & .Net Framework 3.5
Migrating To Visual Studio 2008 & .Net Framework 3.5
Jeff Blankenburg
 
Developing an ASP.NET Web Application
Developing an ASP.NET Web ApplicationDeveloping an ASP.NET Web Application
Developing an ASP.NET Web Application
Rishi Kothari
 
Migrating To Visual Studio 2008 & .Net Framework 3.5
Migrating To Visual Studio 2008 & .Net Framework 3.5Migrating To Visual Studio 2008 & .Net Framework 3.5
Migrating To Visual Studio 2008 & .Net Framework 3.5
Clint Edmonson
 
Asp.Net 2.0 Presentation
Asp.Net 2.0 PresentationAsp.Net 2.0 Presentation
Asp.Net 2.0 Presentation
sasidhar
 
Introductionto asp net-ppt
Introductionto asp net-pptIntroductionto asp net-ppt
Introductionto asp net-ppt
tmasyam
 
Super billing asp.net
Super billing   asp.netSuper billing   asp.net
Super billing asp.net
superb11b
 
Usability AJAX and other ASP.NET Features
Usability AJAX and other ASP.NET FeaturesUsability AJAX and other ASP.NET Features
Usability AJAX and other ASP.NET Features
Peter Gfader
 
DevNext - Web Programming Concepts Using Asp Net
DevNext - Web Programming Concepts Using Asp NetDevNext - Web Programming Concepts Using Asp Net
DevNext - Web Programming Concepts Using Asp Net
Adil Mughal
 
Overview of ASP.Net by software outsourcing company india
Overview of ASP.Net by software outsourcing company indiaOverview of ASP.Net by software outsourcing company india
Overview of ASP.Net by software outsourcing company india
Jignesh Aakoliya
 
ASP.NET MVC introduction
ASP.NET MVC introductionASP.NET MVC introduction
ASP.NET MVC introduction
Tomi Juhola
 
PPT on javascript ajax and css and some points related to server
PPT on javascript ajax and css and some points related to serverPPT on javascript ajax and css and some points related to server
PPT on javascript ajax and css and some points related to server
shivanichourasia01
 
ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008
Caleb Jenkins
 
Ad

More from Information Technology (20)

Web303
Web303Web303
Web303
Information Technology
 
Sql Server Security Best Practices
Sql Server Security Best PracticesSql Server Security Best Practices
Sql Server Security Best Practices
Information Technology
 
SAN
SANSAN
SAN
Information Technology
 
SAN Review
SAN ReviewSAN Review
SAN Review
Information Technology
 
SQL 2005 Disk IO Performance
SQL 2005 Disk IO PerformanceSQL 2005 Disk IO Performance
SQL 2005 Disk IO Performance
Information Technology
 
RAID Review
RAID ReviewRAID Review
RAID Review
Information Technology
 
Review of SQL
Review of SQLReview of SQL
Review of SQL
Information Technology
 
Sql 2005 high availability
Sql 2005 high availabilitySql 2005 high availability
Sql 2005 high availability
Information Technology
 
IIS 7: The Administrator’s Guide
IIS 7: The Administrator’s GuideIIS 7: The Administrator’s Guide
IIS 7: The Administrator’s Guide
Information Technology
 
MOSS 2007 Deployment Fundamentals -Part2
MOSS 2007 Deployment Fundamentals -Part2MOSS 2007 Deployment Fundamentals -Part2
MOSS 2007 Deployment Fundamentals -Part2
Information Technology
 
MOSS 2007 Deployment Fundamentals -Part1
MOSS 2007 Deployment Fundamentals -Part1MOSS 2007 Deployment Fundamentals -Part1
MOSS 2007 Deployment Fundamentals -Part1
Information Technology
 
Clustering and High Availability
Clustering and High Availability Clustering and High Availability
Clustering and High Availability
Information Technology
 
F5 beyond load balancer (nov 2009)
F5 beyond load balancer (nov 2009)F5 beyond load balancer (nov 2009)
F5 beyond load balancer (nov 2009)
Information Technology
 
WSS 3.0 & SharePoint 2007
WSS 3.0 & SharePoint 2007WSS 3.0 & SharePoint 2007
WSS 3.0 & SharePoint 2007
Information Technology
 
SharePoint Topology
SharePoint Topology SharePoint Topology
SharePoint Topology
Information Technology
 
Sharepoint Deployments
Sharepoint DeploymentsSharepoint Deployments
Sharepoint Deployments
Information Technology
 
Microsoft Clustering
Microsoft ClusteringMicrosoft Clustering
Microsoft Clustering
Information Technology
 
Scalable Internet Servers and Load Balancing
Scalable Internet Servers and Load BalancingScalable Internet Servers and Load Balancing
Scalable Internet Servers and Load Balancing
Information Technology
 
Web Hacking
Web HackingWeb Hacking
Web Hacking
Information Technology
 
Internet Traffic Monitoring and Analysis
Internet Traffic Monitoring and AnalysisInternet Traffic Monitoring and Analysis
Internet Traffic Monitoring and Analysis
Information Technology
 

Recently uploaded (20)

Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Hands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordDataHands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordData
Lynda Kane
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Salesforce AI Associate 2 of 2 Certification.docx
Salesforce AI Associate 2 of 2 Certification.docxSalesforce AI Associate 2 of 2 Certification.docx
Salesforce AI Associate 2 of 2 Certification.docx
José Enrique López Rivera
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Buckeye Dreamin' 2023: De-fogging Debug Logs
Buckeye Dreamin' 2023: De-fogging Debug LogsBuckeye Dreamin' 2023: De-fogging Debug Logs
Buckeye Dreamin' 2023: De-fogging Debug Logs
Lynda Kane
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Leading AI Innovation As A Product Manager - Michael Jidael
Leading AI Innovation As A Product Manager - Michael JidaelLeading AI Innovation As A Product Manager - Michael Jidael
Leading AI Innovation As A Product Manager - Michael Jidael
Michael Jidael
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Datastucture-Unit 4-Linked List Presentation.pptx
Datastucture-Unit 4-Linked List Presentation.pptxDatastucture-Unit 4-Linked List Presentation.pptx
Datastucture-Unit 4-Linked List Presentation.pptx
kaleeswaric3
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Hands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordDataHands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordData
Lynda Kane
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Salesforce AI Associate 2 of 2 Certification.docx
Salesforce AI Associate 2 of 2 Certification.docxSalesforce AI Associate 2 of 2 Certification.docx
Salesforce AI Associate 2 of 2 Certification.docx
José Enrique López Rivera
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Buckeye Dreamin' 2023: De-fogging Debug Logs
Buckeye Dreamin' 2023: De-fogging Debug LogsBuckeye Dreamin' 2023: De-fogging Debug Logs
Buckeye Dreamin' 2023: De-fogging Debug Logs
Lynda Kane
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Leading AI Innovation As A Product Manager - Michael Jidael
Leading AI Innovation As A Product Manager - Michael JidaelLeading AI Innovation As A Product Manager - Michael Jidael
Leading AI Innovation As A Product Manager - Michael Jidael
Michael Jidael
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Datastucture-Unit 4-Linked List Presentation.pptx
Datastucture-Unit 4-Linked List Presentation.pptxDatastucture-Unit 4-Linked List Presentation.pptx
Datastucture-Unit 4-Linked List Presentation.pptx
kaleeswaric3
 

Migration from ASP to ASP.NET

  • 1. Migration from ASP to ASP.NET Anand M. Hegde Developer Support Engineer Microsoft Developer Support Microsoft Corporation
  • 2. Overview Why should you migrate? Introduction to Microsoft® ASP.NET Key changes from ASP to ASP.NET Migrating from ASP to ASP.NET Migrating applications that use COM components Migrating applications that use databases Migration best practices ASP to ASP.NET compatibility FAQ Resources for ASP.NET and migration
  • 3. Why Should You Migrate? Increased scalability and reliability Minimum 2X to 3X performance gain Built-in cross-browser compatibility Rich server-side controls, Microsoft Visual Studio® .NET designer support, and configuration options X-copy deployment of pages and components Better debugger; tracing options Content-code separation Take advantage of new caching features Enhanced state-management features ASP and ASP.NET can run side-by-side if required Many new features
  • 4. Before You Migrate Get a good understanding of ASP.NET Know the changes from ASP to ASP.NET Understand that migration requires code changes Although ASP.NET has excellent backward compatibility, migration may not be as easy as it seems in many cases
  • 5. Introduction to ASP.NET ASP.NET is: A new programming framework for Web applications An overhaul of ASP A part of Microsoft .NET Compiled and event driven programming model It permits you to: Rapidly develop powerful Web applications and services Easily build, deploy, and run Web applications that can target any browser or device It requires: Microsoft Windows® 2000 or later for hosting and development
  • 7. ASP.NET Request Flow ASPX engine Gen’d page class file Page class ASPX file Request Parse Generate Instantiate, process, and render Response Request Code behind class file Response Instantiate
  • 8. ASP.NET Page Life Cycle ASP.NET pages are event based Event flow in ASPX pages Page_Init: the page and controls are initialized Page_Load: all the controls and page are loaded Change events for controls are processed Click events for controls are processed Page_PreRender: page is about to render Page_Unload: page is unloaded from memory
  • 9. ASP Programming Models Two types of programming models exist ASPX page only: contains HTML, control tags, and code Code behind model: ASPX file contains HTML and control tags, and a “code behind” file contains code A true separation between code and content One File Two files. (“code behind” model) Page.aspx Page.aspx Page.aspx.vb <Tags> + Code <Tags> Code
  • 10. ASP.NET Features Life made easy for developers Excellent backward compatibility with classic ASP Visual Studio designer support, rich server controls, and base class library support Write code in the language of your choice Call Microsoft Win32® APIs directly Structured error handling Great debugging and tracing support
  • 11. ASP.NET Features (2) Performance, scalability, and reliability Compiled code means speed Cache APIs to improve performance and scalability Built-in support for WebFarms and WebGardens Nonstop availability and protection against deadlocks, memory leaks, and so on
  • 12. ASP.NET Features (3) Easy deployment X-copy deployment Dynamic updates without interrupting the service No more registry! — u se XML-based configuration files New application models Develop mobile Internet applications with ease Built-in support to use XML WebServices More control with the new security model Flexible session state management Many other new features
  • 13. Core Object Changes Request object changes: Request(item) , Request.QueryString(item) , and Request.Form(item) now return a name value collection In classic ASP, they return an array of strings Use Response.Write with caution It will output results at the top of the page before the <HTML> tag Instead: Use server controls (placeholder) Use <% %> tags if you want the output to appear in the right place Each of the core objects now have many new properties and methods. There are some new objects available For example: cache, user and trace
  • 14. Structural Changes One page – one language No mixing of languages in single page A page can have only one server-side Form tag and it must submit to the same page An ASPX page may contain: Directives: <%@ Directive %> Server controls: <tag runat=server> Code blocks: <script runat=server> Data binding expressions: <%# %> Server-side comments: <%-- --%> Server-side includes: <!-- #include --> Render code: <%= %> and <% %>
  • 15. Structural Changes (2) Code block – related changes You cannot declare functions inside <% %> tags Declare all your functions and variables inside the server-side <SCRIPT> blocks <Script runat=“server” language=“vb”> dim gVar as String ‘Page level variable private sub MySubRoutine() Label1.Text = gVar End Sub </Script >
  • 16. Structural Changes (3) No Render functions permited Change: <% MyRenderFunction Sub MyRenderFunction() %> <h1> Hi there! </h1> <%end sub%> To: <% Call MyRenderFunction()%> <script runat=“server” language=“vb”> Response.Write(“Hi there!”) </script>
  • 17. Structural Changes (4) New page directives In ASP, directives had to be at the top of the page, but you do not have to do this anymore You can now have multiple directives on the same page Sample page directive: <%@ Page Language=&quot;VB&quot; ContentType=&quot;text/xml&quot; %> See the documents on new page directives
  • 18. Application Configuration Changes ASP.NET application settings are stored in XML configuration files Types of configuration files Machine.config Contains machine-wide settings Web.Config Contains project/application-wide settings Easy programmatic access to the data in these files Some of the settings in the IIS snap-in are ignored For example: application protection level, session state
  • 19. Session Management Changes New session state storage mechanisms InProc – session data stored on local computer (fastest) StateServer – session data stored in a state service that can be located anywhere; ideal for WebFarms (faster) SQLServer – session data stored in Microsoft SQL Server™ (fast) Off – disable session state Session state can be configured using <sessionState> section Can store COM components in session only in InProc Can store managed components in any session state modes
  • 20. Security Related Changes The IIS part of the security remains same New robust and flexible security model is based on the security sections in the configuration files New authentication modes Windows: uses Windows Authentication Forms: uses cookie-based custom logon forms Passport: uses the Microsoft .NET Passport Service None: no authentication Authorization modes permit you to control access to resources: File authorization URL authorization Permit and deny users access to the application
  • 21. Migrating VBScript to Visual Basic .NET No VBScript in ASP.NET — it’s all Microsoft Visual Basic® .NET! Changing the file name extension to .aspx is the first step Visual Basic language changes Option Explicit is now the default No more “variant” type — use type “Object” Method and function calls with parameters now require parenthesis, so change: <% Response.Write “Hi” %> to <% Response.Write (“Hi”) %> By default, arguments are passed by value Arrays are now zero based
  • 22. Visual Basic Language Changes Let and Set are not supported, so change: Set MyObj1 = MyObj2 to MyObj1 = MyObj2 No more default properties (except for indexed properties), so change: MyString as string = Textbox1 to MyString as string = Textbox.Text Integer data type is now 32 bits and a Long data type is 64 bits Use structured error handling (try catch block) instead of On Error (On Error still works) Must cast data types explicitly: Response.Write (“Count=“ & CStr(MyCount)) or Response.Write(“Count=“ & CType(MyCount, String))
  • 23. Visual Basic Language Changes (2) Must have spaces around “&” while doing string concatenation, so change: x = str1&str2 to x = str1 & str2 Property Get, Property Set, and Property Let are not supported anymore, so instead use: Public Property MyCount as Integer Get MyCount = InternalValue End Get Set InternalValue = value End Set End Property
  • 24. Migrating JScript to JScript .NET Start by changing the file name extension to .aspx Declare your variables explicitly Microsoft JScript® .NET language changes You can now pass variables by reference “ expando” modifier available to extend user-defined objects Can use COM components directly from JScript .NET Server Object’s methods are case sensitive The Arguments object is not available — use a parameter array instead Functions cannot be redefined For Large pages, move function/method code out of <% %> blocks to <Script runat=“server”> blocks
  • 25. Migrating Applications that Use COM Components COM related changes: ASP.NET uses MTA instead of STA Pages with STA components may or may not perform well Early binding is preferred in ASP.NET Cannot use ASPCOMPAT with WebServices COM Interop Can use all your former COM components in ASP.NET Use ASPCOMPAT keyword if you plan to use existing STA components in ASP.NET Use ASPCOMPAT only when using STA objects or when your COM objects access ASP intrinsic objects
  • 26. COM Objects Migration — FAQ What if the page contains both MTA and STA? Use ASPCOMPAT What if I have a middle tier containing COM objects? Use horizontal or vertical migration strategies What about the performance if I use existing COM objects? Very little overhead if the method does substantial tasks Significant overhead if the method does not do much
  • 27. COM Objects Migration — FAQ (2) What about deploying COM objects used in ASPX pages? If you want to use Server.CreateObject, then there is no change If you use early binding then use the PIA (Primary Interop Assembly) for the COM component and make sure you deploy the PIA on the target server How can I use STA components from XML WebServices? Register the component in COM+ and make sure you are running Windows 2000 SP2
  • 28. Migrating Applications that Use Databases Data access changes ADO (through Interop) can be used, but Microsoft does not recommend it ADO and ADO.NET are quite different ADO.NET is not exactly backward compatible Three main objects in ADO.NET: DataSet, DataReader, and DataAdapter Two built-in managed data providers: SQLClient and OLEDB Built-in designer support for ADO.NET objects in Visual Studio .NET
  • 29. Migrating Applications that Use Databases (2) Strategies Rewrite ADO code in ADO.NET instead of migrating Keep ADO code as a short term approach If you use ADO code in ASP pages, use Primary Interop Assembly for ADO on both the developer box and the server If you need read-only data, use a DataReader
  • 30. Data Access Migration — FAQ What if my application has straight ADO code in ASP pages? Use ASPCOMPAT to use the code as it is (may be slower) Rewrite the data access code to use ADO.NET What if my application has COM objects that use data access? Use the ASPCOMPAT attribute (if component uses STA) What if my database has no managed providers? You can use OLEDB providers in ADO.NET If there are no OLEDB providers, use ODBC managed provider
  • 31. Data Access migration — FAQ (2) What if I have a data access tier? Make these objects call Web Services or managed components Later on, modify the presentation layer to use only .NET middle tier Do I have to package ADO Components during deployment? Make sure your server has MDAC 2.6 installed Make sure you also deploy the PIA for ADODB on the server
  • 32. General Migration Strategy Identify the parts of the application that you have to migrate Plan very carefully and try to have minimal impact on the existing application during the migration In a multi-tier scenario, take the horizontal or vertical approach Horizontal – migrate the whole tier (middle/presentation) at the same time Vertical – migrate some pages, some components, at the same time Decide if you want to reuse existing COM components
  • 33. General Migration Strategy (2) Decide if you want to keep current ADO code for a while Rename the file name extension from .asp to .aspx Make the language-specific changes first Make COM- and database-specific changes Test, test, test
  • 34. Migration Best Practices General If the application is relatively small, consider rewriting If the application is very large, then plan carefully and migrate part by part If you only want to make a syntactic port, then consider only ASPX pages (that is, not using the “code behind” model) and do not make unnecessary changes You do not have to port the whole site at the same time Consider migrating the slow/critical parts Remember, you can run ASP and ASP.NET side-by-side Try to migrate the read-only pages first Write automated tools to do some tasks
  • 35. Migration Best Practices (2) Language related Strongly type all the variables If possible, convert all the On Error statements to try catch blocks Remember that they may not be as easy as they look Convert Include files into assemblies or user controls (.ascx) Use call keyword for function calls and use parenthesis for function and subroutine calls Identify default properties and replace them appropriately Always use Option Explicit
  • 36. Migration Best Practices (3) Data access related If you have a data access tier, move it into .NET COM related Always use early binding Explicitly free resources from code Project management related Keep two code trees while migrating, and make sure to update both of them while adding changes to the existing Web site First try to modify the existing code as it is After you complete this, try to modify the application to use the advantages provided by .NET
  • 37. Migration Best Practices (4) Testing related Update existing links to your Web site/pages because the file name extension is now .aspx Use a link checker to check any broken links, images, paths, and so on Test very well
  • 38. ASP to ASP.NET Compatibility — FAQ How can ASP and ASP.NET co-exist? Because they have different file name extensions (.asp and .aspx) Because they have different application settings (registry and config files) Can they share session and application data? No – w rite custom code or use third-party component What about Global.asa in ASP.NET? In ASP.NET, it is called as Global.asax
  • 39. ASP to ASP.NET Compatibility — FAQ (2) Can I use .NET components from ASP, and COM components from ASP.NET? Yes – use CCW to call managed components from ASP Yes – u se RCW to call COM components from ASP.NET What about the anonymous account in ASP.NET? Remains the same What about the hosting process in ASP.NET? ASP.NET applications run under ASPNET_WP.EXE By default, ASP.NET worker process runs under an account called ASPNET
  • 40. ASP to ASP.NET Compatibility — FAQ (3) Do I need to write code for different browsers? No – ASP.NET produces HTML 3.2 compliant output Can I still use ADO from ASP.NET? Yes – y ou can use ADO through Interop, but ADO.NET is preferred What about Include files? Can be used, but better to convert them to class libraries or user controls (.ascx) instead Can I call ASP pages from ASPX and vice versa? Yes
  • 41. ASP.NET Resources ASP.NET Quick Start Tutorials Authentication in ASP.NET Security ASP.NET Security Session State in ASP.NET ASP.NET Configuration http://www.gotdotnet.com http://www.asp.net http://www.ibuyspy.com
  • 42. Migration Resources Migrating to ASP.NET: Key Considerations Migrating ASP Pages to ASP.NET Converting ASP to ASP.NET Upgrading to Microsoft .NET on GotDotNet Upgrading to .NET on MSDN Upgrading from JScript to JScript .NET Microsoft .NET/COM Migration and Interoperability Q314775 , “INFO: Migrating Visual InterDev Design-Time Controls to ASP.NET” .NET Migration Case Study
  • 43. Thank you for joining us for today’s Microsoft Support WebCast. For information about all upcoming Support WebCasts and access to the archived content (streaming media files, PowerPoint® slides, and transcripts), please visit: http://support.microsoft.com/webcasts/ We sincerely appreciate your feedback. Please send any comments or suggestions regarding the Support WebCasts to [email_address] .