190 likes | 346 Views
ASP.net 1.1 to ASP.net 2.0 Migration. Harish Ranganathan Live Web Developer Evangelist | Microsoft India http://geekswithblogs.net/ranganh | hrangan@microsoft.com. Understanding the Differences. Visual Studio.NET 2003 => Visual Studio 2005 Web Matrix => Visual Web Developer Express
E N D
ASP.net 1.1 to ASP.net 2.0Migration Harish Ranganathan Live Web Developer Evangelist | Microsoft India http://geekswithblogs.net/ranganh | hrangan@microsoft.com
Understanding the Differences • Visual Studio.NET 2003 => Visual Studio 2005 • Web Matrix => Visual Web Developer Express • Web Application => Website / Web Application *
DEMO ASP.net 2.0 / Visual Studio 2005
Today if I were to do this • Better off, migrating to ASP.NET 3.5 • Visual Studio 2008 or equivalent Express Edition • Flexible to chose Web App / Website
Architecture Differences in ASP.net 2.0 • Completely rewritten for performance /security • New version of .NET Framework • Fully backward compatible • Tremendous Enhancements to Web Developers
Naming a few • Provider Model • Membership API • New Navigation Controls (TreeView, Sitemap) • Flexible Deployment Options
DEMO ASP.net 2.0 features
ASP.NET 1.X to ASP.NET 2.0 • New ASP.NET reserved directory names (App_) • New naming convention for protecting directories • Avoid naming directories with this prefix • ASP.NET Reserved directories • /Bin – Reserved for assemblies. Same as 1.0 and 1.1 • /App_Code – Reserved for code • /App_Data – Reserved for data storage (*.mdf, .xml, etc.) • /App_Themes – Reserved for theme files (.skin) • /App_WebServices – Reserved for .wsdl files • /App_Resouces – Reserved for local page resource files • /App_GlobalResources – Reserved for global resource files
ASP.NET 1.X to ASP.NET 2.0 • XHTML compliance switch • XHTML compliant markup is now emitted by default • Good for standards compliance, but can break some UI • <xhtml11Conformance enableLegacyRendering=“true” /> • Web.config file setting to use older HTML markup rendering
ASP.NET 1.X to ASP.NET 2.0 • Other XHTML issues: • New pages created using VS2005 include a DOCTYPE directive indicating XHTML 1.1 compliance • IE will render page in browser differently if DOCTYPE present • Remove the DOCTYPE to get older html rendering behavior • In future you should update your HTML to be XHTML compliant
ASP.NET 1.X to ASP.NET 2.0 • Well known client-side script files are now encapsulated as resources • .js files are now referenced like: WebResource.axd?a=s&r=WebUIValidation.js • Hand-editing WebUIValidation.js file will no longer work • Use the expanded client-side scripting support in ASP.NET 2.0 for enabling common client-scripting scenarios instead
ASP.NET 1.X to ASP.NET 2.0 • Potential for naming collisions with existing source code • 2,000+ new classes in V2.0 • Common name collisions: Membership, Roles, Profile, Theme • Name collisions do not affect already compiled binaries • CLR automatically picks the correct type to use in this case • Name collisions will affect you if you re-compile your project source • Recommend you identify collision candidates today • Use a fully qualified class name when referencing these types • (e.g. MyProject.Membership instead of Membership) • Alternatively use an alternative class name to avoid future issues
Session Summary • ASP.NET V1.1 and V2.0 run side-by-side on same server • No need to migrate all apps in order to start using V2.0 • Backwards compatibility a priority with new APIs and features • Please tell us in Beta2 when you find things that break • VS 2005 auto upgrades existing web projects to use new project model • Provides significantly better flexibility for web projects • Need to be aware of a few implications of dynamic compilation model • Things to-do today to prepare for ASP.NET V2.0: • Start making HTML markup XHTML compliant • Separate non-codebehind classes/enums into separate class files • Avoid class naming conflicts with new V2.0 features now where possible
References • ASP.net 2.0 Providers http://msdn.microsoft.com/en-us/library/aa478948.aspx
Feedback / QnA • Your Feedback is Important! Please take a few moments to fill out our online feedback form • Use the Question Manager on LiveMeeting to ask your questions now!
Contact (optional slide) • Blog Address http://geekswithblogs.net/ranganh • Email Address hrangan@microsoft.com