Top Ten New and Exciting Features in ASP.NET 2.0ASP.NET 1.0 was a revolutionary advance in developing Web Applications. With its fully complied, highly extensible Server-Side control model, it was one of the best applications of Microsoft's .NET runtime. IT Solved Many of the Issues Plaguing ASP Developers, and Kept The Development-Centric Philosophy That Made ASP Such A huge hit Amongst the Web-Client Community.
But problems remained with the ASP.NET 1.0 release, not an entirely unexpected situation given it was, after all, a 1.0 product. Developers found themselves writing a lot more code than they thought was good, and it was more difficult than it should have BEEN to Keep Presentation and Business Logic Well-Partitioned and Separate.
With ASP.NET 2.0, the ASP.NET team has continued to lead the way in making developer's daily lives more enjoyable. The main theme of ASP.NET 2.0 seems to be "write less code". In this article, with homage to David Letterman, we will count down my top ten favorite features of this new runtime. (Feel free to imagine the top ten list being enthusiastically read by Bill Gates, but of course, in your imagination he will only be reading the topics themselves-I will Be Reading The actual explanations.
With no further ado, we begin, as always, with:
10) Application-wide registration of custom controls. One of my biggest complaints about custom controls (and this was true of both UserControls and custom controls from a custom assembly) was that you had to put a "<% @ Register%>" directive At the top of every .aspx page from which you wanded to declare an instance of the control.
One of the main purposes of custom controls was to be able to use them from multiple .aspx pages in one application. Since controls typically encapsulate elements like menus, site navigation etc., it seems counterintuitive (counterintuitive) to me that in order to reuse that code, you have to add something to each and every page. But in ASP.NET 1.0, there has to be one Register directive for each assembly / namespace combination and one for each UserControl. If you need to add a new custom Control, you have to go ion to ready page where you want to use it, and add it mantly.in asp.net 2.0, you can add the register directives to the web.config.
You might wonder, if I was so worked up (excited, angry) OVER IN ASP.NET 1.0, why it is number 10 on my list and not number 1? To be fair, despite my ranting, it was annoying, but not Really Life-Threatening. It unsually wasn't Too Hard To Find The Problem in The First Place, and A Simple Cut-Paste Operation Usually Fixed The Problem in Seconds.
9) Programmable Configuration.This is really a .NET runtime improvement, but it is still a big win for ASP.NET. The web.config file contains all the configuration information for an ASP.NET application. In ASP.NET 1.0, in order to change something (like a database connection string in the AppSettings element) you have to open the web.config file in the text editor of your choice.With the new version, you can go into the configuration programmatically (without having to resort to ............................ ..
8) Web Part controls.Even though the personalization craze (enthusiasm) of the web has somewhat died down (weakened) in recent years, there still are plenty of situations in which you will need to expose customization of pages to your end users.
With Web Parts, the ASP.NET team has given us a way to do that without writing any additional code. The WebPartZone control is used to define an "area" of the page that can be customized. Each zone can be made up of multiple parts which can be a ContentWebPart control, a custom control, or a UserControl. Used in conjunction with the WebPartManager controls, you can give your end users the ability to change where the controls in their page are displayed.
7) Posting to other pages.One programming paradigm that ASP.NET 1.0 developers had to get used to was that the HTML forms in ASP.NET 1.0 had to have their action attribute refer back to the page that created the rendered page.
This was not so much a limitation on functionality, since with Response.Redirect or Server.Transfer, moving a user from one page to the other was just a matter of maintaining the page's state for the second page to retrieve. But it was a nuisance (trouble) just slightly above the @Register directive on the annoyance scale.ASP.NET 2.0 gives controls that cause a post-back to the server the ability to change the action of the form in the HTML page, causing the page's state And Data to Be Posted Directly TO an ASP.NET Page Other Than The One That CREATED IT.
In The ASP.NET Where You Are Declaring The Server-Side Controls You Set The PostbackURL Property To The Aspx Page You'd Like The Form To Submit To.
.
6) SQL Cache Dependency.The ASP.NET 1.0 HttpCache class was a great feature for maintaining application-level state. One of the coolest features was the ability to create a dependency between an object you placed into the cache with another object, a file .
Since frequently the object that you put into the cache related back to a table in your database, probably the question I got asked the most often when lecturing on ASP.NET was whether an object put into the cache could be invalidated when the underlying table changed . 'S new answer is yes.
To make this work, you first have to configure the SQL Server instance using the aspnet_regsql.exe command line tool. Then create an instance of the SqlCacheDependency class and add that into the Cache object when adding your data to the Cache.5) Master Pages .Using importation inheritance WAS a Cornerstone of the ASP.NET 1.0 Model. Each .a .aspx Page Was Compiled Into a .NET Class, And System.Web.ui.page Was That Class' Eventual Base Class.
One oft-used technique in ASP.NET 1.0 was to create a "master page class". This class derived from Page and generally had all the common functionality that each and every .aspx page in an application needed to use. It was trivial to Get asp.net to use this class as the base class for all classes generated from your .aspx files.
Since ASP.NET is a framework to create user interfaces, the downside of this "master base class" model was that any server-side controls that were added dynamically via this class would not appear in the .aspx file designer in Visual Studio. Net.
In ASP.NET 2.0 there is a new feature called Master Pages. Master Pages are essentially ASP.NET syntax in a file with the .master extension. A Master Page can be created and serves the same purpose as the "master base class". There Are Two Main Differences with the master page model.
ONE, The .Master Pages Are Visually Designable. NOT Only That, When a .aspx Page Uses A Master Page
TWO, The Master page isn't Used as the base class for the .aspx file.
4) Visual Studio .Net Project Model.one Complaint That Was Heard Around The World About ASP.NET 1.0 WASN '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' a number of different compilation and deployment models, VS.NET was fairly myopic in its view of how everyone should develop ASP.NET web applications. VS.NET's model was not wrong for every scenario, but it was wrong in enough instances to warrant A FAIRLY BAD RAP WHEN Developing Asp.Net.in ASP.NET 2.0, VS.NET (Specification VS.NET 2005) Is Much More Flexible. It is flexible in Terms of What Part of An ASP.NET Application May BE Open in The IDE AT One Time (no more solimention file). Vs.net 2005 allows you to use a "codebehind" file or not, it is up to you, where vs.net 2002/2003 Both strictly enforced the "codebehind" File Model.
3) Visual Studio .Net /ASP.NET Compilation Model.in Close Connection With Item Number 4, VS.NET 2005 Also Frees The INTREPID Developer to Compile At Will. In Fact, Late Compilation Is The Norm With 2005, Which Again Is The Opposite of the 2002/2003 model.
Part of this new lax view towards compilation goes hand in hand new features built into ASP.NET 2.0. ASP.NET 2.0 takes advantage of the new feature built into C # and the CLR itself which allows a class to be defined in multiple files with. Essentially, instead of "codebehind", we now have "codebeside", in which the class created from the .aspx file gets compiled into the same class that can exist in another file. This straightens out some of the weird object-oriented weirdness that Sometimes Ensued Because of Asp.Net 1.0's Derived (.aspx) Base Class ("CodeBehind") Model.
Also with ASP.NET 2.0 there is a command line compiler (aspnet_compile) that allows you to precompile a whole ASP.NET application. This feature is also exposed with a specialized handler which can be found at the precompile.axd endpoint in your application. 2) Provider model. When the ASP.NET team looked at the code being written in the real world, they saw many chunks of code they felt they could build into the runtime itself. Many of these chunks need some data to back up the UI . Of Course the ASP.NET TEAM COULDN'T Choose a Data Source for Every.
THIS LAYER IS KNOWN AS A Provider. A Provider Sits Between The Ui Piece (Which Could Be An ADO.NET DATA SOURCE, AN XML File, or Something ELSE). The Provider generally derives from a specific base class and that base class has methods that the UI piece can call to get the data necessary to render itself. ASP.NET 2.0 ships with providers for the most common types of data. If you have a different data source You are free to build your owned provider.
One standout example is membership. For membership, ASP.NET 2.0 ships a provider for Access and SQL Server, and a set of controls that allow logins, account creation, account editing, password reminders, etc. Building a gated web site with these new Controls and a provider is real a snap.
1) Declarative Databinding.In ASP.NET 1.0, Databinding was one of the top features. Freeing developers from looping over rows of data and concatenating strings to generate HTML by allowing a control to just take a data object and run with it, with the rendered HTML being created based upon properties set on the control, was a genius idea. The only slight problem was that in order to make Databinding work, we still had to write code.In ASP.NET 2.0, they introduce the concept of Declarative Databinding , which essentially allows you to declare the properties you want on your data source with the same declarative model you use to declare the server-side controls themselves. Datasource objects are created in the same way as server-side controls, by dragging and dropping them From the Toolbox, or by adding the declaration to the .aspx file. Once Configured, a DataSource Can Be bound to a data-bound control.
Clearly, there are a lot more than just 10 new features in the ASP.NET 2.0 release; we could easily have turned this into a Top Twenty, Top Fifty or even Top One Hundred list, had we wanted ASP.NET marks a huge. new set of functionality, driven by customer demands and requests, and your Top Ten list will likely differ from my own, depending on your experience and history with ASP.NET. But in the meantime, while you're building your own list, try Starting with these 10-I Think You'll Like these New Features Just As Much as I do.