Blue Theme Orange Theme Green Theme Red Theme
 
Team Foundation Server Hosting
Home | Forums | ASP.NET 2.0 Tutorials | Web Services | How Do I...? | Class Browser | WPF Quick Starts | Advertise with Us
 | Consulting  
Submit an Article Submit a Blog 
 Jump to
Skip Navigation Links
TechnologyExpand Technology
WebsiteExpand Website
Nevron Gauge for SharePoint
Search :       Advanced Search »
Home » ASP.NET » Comparison chart between ASP 1.x and ASP 2.0

Comparison chart between ASP 1.x and ASP 2.0

This article explores a comparison chart between ASP.NET 1.x and ASP.NET 2.0.

Page Views : 6562
Downloads : 0
Rating :
 Rate it
Level : Beginner
   Print Read/Post comments Post a comment  Similar Articles  
   Email to a friend  Bookmark  Author's other articles  
 
Team Foundation Server Hosting
Become a Sponsor
Become a Sponsor
 Tag Cloud
 Latest Jobs
More ... 
 Latest Interview Questions
More ... 

Summary: This article explores a comparison chart between ASP.NET 1.x and ASP.NET 2.0.

Applies to:

  • Microsoft Visual Basic 6.0
  • Microsoft Visual Basic 2005
  • Microsoft Visual Studio .NET 2003
  • Microsoft Visual Studio 2005
  • Microsoft .NET Framework 1.1
  • Microsoft .NET Framework 2.0

Comparison chart between ASP.NET 2003 and ASP.NET 2005

The following table explains some of the basic comparison between ASP.NET 1.X to ASP.NET 2.0.

ASP.NET 2003 ASP.NET 2005
During the compilation of .NET application 1.x, Visual Studio 2003 would automatically compile only certain file types such as ASP.NET pages, Web services, user controls, HTTP handlers, Resource files and Global.asax class files.  The rest of the file need to explicitly compile before finally publishing your code to the web server.

In Visual Studio 2005, you no longer need to compile all the files into an assembly. The ASP.NET dynamic compile engine allows to automatically compile the applications, that includes .aspx, .cs, .vb files.  That means, simply create application and publish it.

A shared class consists of reusable source components in the Code folder.

The new Code-Separation model extends the Compile-on-Demand feature to the classes bound to a Web page, but it does not stop there; helper classes can also take advantage of it. You can keep your helper classes and business objects in the App_Code folder. ASP.NET monitors the folder and compiles any new class file that is added or edited. The resulting assembly is automatically referenced in the application and shared between all pages participating in the site.

You should put only components into the App_Code folder. Do not put pages, Web user controls, or other non-code files containing non-code elements into the App_Code subdirectory. All the files in the App_Code folder are dynamically compiled to a single assembly, named code.dll. The assembly has application scope and is created in the Temporary ASP.NET Files folder, well outside the Web application space.

For modify an application, you need to open the entire project, make changes and need to recompile again to publish the code to the web server. You just need to open the individual file which you want to make the changes and publish the code to the web server without having to recompile.
The code-behind model requires IIS Virtual Directory. The code-behind model can directly access the local installation of IIS. The code-behind model lacks support for FTP, local file system, and direct IIS access. The code-behind model has multiple ways to open Web sites.
It requires IIS on development computer. It has already built-in Web server.
Unable to open individual pages outside the project. Need not open the entire project; you can open individual pages outside the project, it is achieved through Compile-on-demand feature.
It requires explicit addition of files to the project. It eliminates the need to explicitly add files to the project.
The compilation models of ASP.NET 1.x and ASP.NET 2.0 built on completely different bases. The new class-derivation model enables the page to define controls without the need to have protected members created in the inherited separation file, or to have explicit event definition.

Pages that use code separation take advantage of a feature known as Partial Classes.  When the page runs, ASP.NET 2.0 dynamically creates and instantiates a class representing the page and the compiler uses the CodeFile attribute in the @Page directive to find the file containing the code.

The Inherits attributes defines the name of the class that will be created and this should be default, the page name as the basis for creating the class name.

  The @Page directive in ASP.NET 2.0 has several new attributes. These attributes allow developers to control new framework features such as personalization and theming. The Page class in ASP.NET 2.0 also has new properties, methods, and events.

Properties

The properties of the Page object fall into two distinct groups: intrinsic objects and page-specific properties. Intrinsic objects include references to environmental standalone objects such as Cache, User, and Trace. They also include references to the classic intrinsic objects that form the HTTP context, such as Session, Application, and Request. Page-specific properties are all the properties that affect or describe the state of the page, for example, IsPostBack, EnableViewState, and SmartNavigation.

The new properties of the Page class can also be categorized into either of the preceding groups.

The three important new properties are:

  1. ClientScript. Instance of the ClientScriptManager class that represents a separate object, and which groups all the methods working with the client-side scripts.
  2. Header.IPageHeader interface that represents the contents of the page's <head> block if this is marked as runat=server.
  3. Master. Gets the master page that determines the overall look of the page.

Methods

The Page class features several new methods, most of which are simply inherited from the base Control class.

Some of the important methods are:

  • GetValidators. Returns the collection of all validator controls that belong to the specified group.
  • SetFocus. Sets the input focus to a particular control contained in the page.
  • RegisterRequiresControlState. Registers the specified control as one that requires control state management.
In the ASP.NET runtime the life cycle of a page is marked by a series of events. In ASP.NET 1.x, based on user interaction a page request is sent to the Web server. The event that is initiated by the page request is Init. After the Init event, Load event is raised. Following the Load event, PreRender event is raised. Finally, the Unload event is raised and an output page is returned to the client.

ASP.NET 2.0 adds quite a few new events to allow you to follow the request processing more closely and precisely. These new events are discussed in the following table.

New Events in ASP.NET 2.0

Events Description
PreInit This occurs before the page begins initialization. This is the first event in the life of an ASP.NET 2.0 page.
InitComplete This occurs when the page initialization is completed.
PreLoad This occurs immediately after initialization and before the page begins loading the state information.
LoadComplete This occurs at the end of the load stage of the page's life cycle.
PreRenderComplete This occurs when the prerendering phase is complete and all child controls have been created. After this event, the personalization data and the view state are saved and the page renders to HTML.

Developers can dynamically modify the page output and the state of constituent controls by writing these events into the code.

For details of code behind and compilation in ASP.NET, visit the site

http://msdn.microsoft.com/msdnmag/issues/06/01/ExtremeASPNET/

Conclusion

This article has just focused some of the common difference between ASP.Net 1.X and ASP.NET 2.0. Some of the concepts, such as partial class, have greatly simplified things for developers who choose to follow the code-behind model for ASP.NET development without the use of an IDE like Visual Studio.NET. The other features, such as deployment pre-compilation, clearly translate to better performance and protection intellectual property. On the whole, with the introduction of ASP.NET 2.0 Microsoft has provided developers with a wealth of features with plenty of flexibility.

Comment Request!
Thank you for reading this post. Please post your feedback, question, or comments about this post Here.
Login to add your contents and source code to this article
 [Top] Rate this article
 
 About the author
 
Binoy R
Looking for C# Consulting?
C# Consulting is founded in 2002 by the founders of C# Corner. Unlike a traditional consulting company, our consultants are well-known experts in .NET and many of them are MVPs, authors, and trainers. We specialize in Microsoft .NET development and utilize Agile Development and Extreme Programming practices to provide fast pace quick turnaround results. Our software development model is a mix of Agile Development, traditional SDLC, and Waterfall models.
Click here to learn more about C# Consulting.
 
Introducing MaxV - one click. infinite control. Hyper-V Hosting from MaximumASP.
Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
Dynamic PDF
ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
Nevron Chart for .NET 2010.1 Now Available
The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
ASP.NET 4 Hosting
Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites – Click Here!
 
 Post a Feedback, Comment, or Question about this article
Subject:
Comment:
Team Foundation Server Hosting
Become a Sponsor
 Comments

 © 2012  contents copyright of their authors. Rest everything copyright Mindcracker. All rights reserved.