A comparison between ASP.NET 1.x and ASP.NET 2.0






3.34/5 (31 votes)
Mar 17, 2006
6 min read

147925
This article explores a comparison chart between ASP.NET 1.x and ASP.NET 2.0.
Introduction
This article explores a comparison chart between ASP.NET 1.x and ASP.NET 2.0. The following table explains some of the differences between ASP.NET 1.X and ASP.NET 2.0.
ASP.NET 2003 |
ASP.NET 2005 | ||||||||||||
During the compilation of applications for .NET 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 files needed to be explicitly compiled 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 compilation engine allows to automatically compile applications, that includes .aspx, .cs, .vb files. That means, simply create an application and publish it. A 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 an application scope and is created in the Temporary ASP.NET Files folder, well outside the Web application space. | ||||||||||||
For modifying 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 an 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 systems, and direct IIS access. |
The code-behind model has multiple ways to open Web sites. | ||||||||||||
It requires IIS on the development computer. |
It already has a 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 the 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 are 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 The | ||||||||||||
|
The PropertiesThe properties of the The new properties of the The three important new properties are:
MethodsThe Some of the important methods are:
| ||||||||||||
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 |
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
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 MSDN.
Conclusion
This article just focused on some of the common differences between ASP.NET 1.X and ASP.NET 2.0. Some of the concepts, such as partial classes, 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 of 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.