
ASP.NET 2.0′s new features can be grouped into three categories: new controls (more than 50 in all), new features in the page framework, and new services. In addition, myriad enhancements have been made to existing controls and services.
What’s New for UIS:-
Master pages
- Visual inheritance” for Web pages
- Applied declaratively or programmatically
Themes and skins
- Theme controls, pages, and entire sites
- Applied declaratively or programmatically
New controls (more than 50 in all)
- Menus, TreeViews, Wizards, and more
ASP.NET 2.0 introduces a number of new features designed to help developers build cutting-edge UIs with a minimum of effort. First there’s master pages, which enable pages to be templatized and which enjoy great design-time support in the Visual Studio 2005 IDE. Next, there’s themes and skins, which allow controls, pages, and even entire sites to be visually themed with the stroke of a mouse. Finally, ASP.NET 2.0 introduces about 50 new control types ranging from the simple (e.g., BulletedList and ImageMap) to the sublime (e.g., GridView, DetailsView, Menu, TreeView, and Wizard).
What’s New in Data Access
Data source controls
- Declarative 2-way data binding
Data controls
- GridView – Like the DataGrid, only better
- DetailsView – Companion to GridView
SQL cache dependencies
- Key cached items to database entities
Simplified data binding expressions
ASP.NET 2.0 makes building data-driven sites easier than ever before by introducing declarative data binding utilizing data source controls (which dramatically reduce the amount of code you have to write), providing new (and very rich) data controls such as GridView and DetailsView, introducing SQL cache dependencies (which allow cached items to be keyed to database entities), and offering an expanded and simplified syntax for data-binding expressions.
TEMPLATES
Data Controls allow template editing
- Item
- Edit
- Insert
- Header
- Footer
Can nest controls within each type
Two-way to parent
What’s New In Security
Membership service
- Service for managing users and credentials
- Provider-based for flexible data storage
Login controls
- Controls for logging in, creating new users, recovering lost passwords, and more
Role Management service
- Combine forms authentication and role-based authorization without writing code!
ASP.NET 1.x simplified forms authentication by introducing declarative means for designating login pages and specifying authorization rules. ASP.NET 2.0 further simplifies forms authentication by providing the following features and services:
- A membership service for managing users and credentials
- Login controls for logging in users, creating new users, and more
- A role management service for enacting role-based security
The result is that forms authentication is easier than ever before and can often be accomplished without writing any code.
Membership & Logins
- Login APIs
- Allows use of advanced features
- Customize logins and registrations
- Perform management activities on users
A first look at ASP.NET 2.0′s Membership service and login controls.
- Step 1: Open the LoginControls project in Visual Studio 2005
- Step 2: Run MembershipInfo.aspx. Inform the audience that “View MembershipUser Info” link at the bottom of the page points to a page that requires authenticated access, so clicking it will send you to a login page. Click the link
- Step 3: Fill in the new user form to create a new user and click the Register button to get to MembershipUserInfo.aspx
- Step 4: Click the Logout button. MembershipInfo.aspx appears
- Step 5: Click the “View MembershipUser Info” link again. Log in using the account you created earlier. Once more, MembershipUserInfo.aspx appears
- Step 6: Click the “Return to Main Page” link. MembershipInfo.aspx appears
- Step 7: Inform the audience that they just saw three login controls demonstrated: Login, CreateUserWizard, and LoginStatus. Also tell them that registering a new user, logging in as that user, and implementing the login/logout link required exactly 0 lines of code, and that this is just a taste of what’s to come when we explore membership, login controls, and role management
Using the Login API:- It features a page containing two SqlDataSources, a DataGrid, and a DropDownList. The SqlDataSource that serves the DataGrid uses the value selected in the DropDownList to perform a parameterized query.
- Step 1: Open the WhatsNew project in Visual Studio 2005
- Step 2: Run SqlDataSource.aspx
- Step 3: Demonstrate that selecting a country from the drop-down list changes the contents of the DataGrid. State that coupling the drop-down list to the DataGrid in this manner requires exactly zero lines of code
- Step 4: Open SqlDataSource.aspx in the designer and switch to Design View. Point out that this page contains two SqlDataSources, and that one serves the drop-down list while the other serves the DataGrid
- Step 5: Switch to Source view and show the audience SqlDataSource1. Point out that it provides content to the drop-down list, and that its SelectCommand uses a SELECT DISTINCT query to retrieve a list of countries from Northwind’s Customers table
- Step 6: Show the audience SqlDataSource2. Point out that it provides content to the DataGrid, and that it uses a parameterized query. Show the “WHERE [Country]=@Country” clause in the SelectCommand, and show the <SelectParameters> element and the <asp:ControlParameter> tag instructing the SqlDataSource to obtain a value for @Country from the drop-down list
- Step 7: Show the ConnectionString attributes in the <asp:SqlDataSource> tags. Call attention to the <%$ … %> expressions that declaratively initialize ConnectionString with a connection string. Inform the audience that the connection string is stored in Web.config
ROLES:-
- Allows segregation of users into groups or “roles”
- Can allow or deny access based on these
- Use the Roles API to perform management features
PROFILES:-
Store per-user data persistently
- Strongly typed access (unlike session state)
- On-demand lookup (unlike session state)
- Long-lived (unlike session state)
- Supports authenticated and anonymous users
Accessed through dynamically compiled HttpProfileBase derivatives (HttpProfile)
Provider-based for flexible data storage
The new profile service makes short work of storing personalization settings and other per-user settings persistently. Classic applications for it include storing “favorites” (like the “My eBay” portion of eBay, which, among other things, lists auction items that you’ve bookmarked so you can scrutinize them later on) and user preferences. The service is profile-based. You define a profile in Web.config, and ASP.NET dynamically compiles that profile, provides strongly typed access to it, and persists profile data. Moreover, profiles work with both anonymous and authenticated users.
Site Navigation:-
- Navigation UIs are tedious to implement( Especially if they rely on client-side script)
- New controls simplify site navigation
- TreeView and Menu – Navigation UI
- SiteMapDataSource – XML site maps
- SiteMapPath – “Bread crumb” control
- Public API provides foundation for controls
- Provider-based for flexibility
Easy site navigation is an important element of modern Web applications. Because much of the time spent developing a site is devoted to building menus, tree views, and other navigational aids, and because changes to a site’s structure require commensurate changes to the navigation UI, ASP.NET 2.0 addresses the issue of site navigation head-on. Menu and TreeView controls simplify the task of building navigation UIs; SiteMapDataSource controls enable changes to a site’s structure to automatically propagate to the navigation UI; and SiteMapPath controls make short work of implementing “bread-crumb” elements showing the path to the current page.
CONFIGURATION:-
Administrative tools
- ASP.NET MMC snap-in
- Web Site Administration Tool (Webadmin.axd)
Configuration API
- Read/write access to configuration settings
- Simplified custom configuration sections
Instrumentation
- Perf counters, health monitoring, and more
In ASP.NET 1.x, editing configuration settings meant manually modifying XML configuration files. In 2.0, two new tools–the ASP.NET MMC snap-in and the Web Site Administration Tool–enable most configuration settings to be applied through administrative GUIs. Both tools represent significant enhancements in usability and should prove especially valuable to admins responsible for managing remotely hosted ASP.NET Web sites.
ASP.NET 2.0’s configuration API fills a hole in ASP.NET 1.x by providing an easy-to-use and extensible API for reading and writing configuration settings. Applications can now read their own configuration settings without parsing raw XML, and they see a merged view of those settings that includes settings inherited from configuration files higher in the directory hierarchy. Moreover, writing configuration settings is as easy as reading them, and implementing custom configuration sections requires little more than deriving from System.Configuration.ConfigurationSection.
ASP.NET 2.0 is also far more heavily instrumented than 1.x. Thanks to the new health monitoring subsystem, a few simple statements in Web.config can configure an application to write an entry to the Windows event log when a login fails, e-mail a system administrator when an unhandled exception occurs, and more. In addition, you can extend the health monitoring subsystem by defining Web events of your own. Other enhancements in this arena include new performance counters supplementing the ones in ASP.NET 2.0, integration with ETW for high-performance end-to-end tracing of requests as they travel through the system, and new options for generating, capturing, and managing trace output.
What’s new in Localization:-
Auto-culture handling
- Declarative mapping of Accept-Language headers to relevant thread properties
Simplified resource handling
- Declarative mapping of control properties to resources using <%$ … %> expressions
- Strongly typed programmatic resource loading
<asp:localize runat=”server”> and more
The big news in localization is that most of it can be done declaratively, whereas in ASP.NET 1.x, localization required explicit code to map Accept-Language headers to Thread properties, initialize control properties from resources, and so on. ASP.NET 2.0′s ability to autocompile RESX files also plays a significant role in simplifying localization.
“Auto-culture handling” refers to the new Culture=”auto” and UICulture=”auto” attributes that can be applied to a page or an entire application to automatically map Accept-Language headers to the current thread’s CurrentCulture and CurrentUICulture properties. “Simplified resource handling” refers to the fact that localization resources are now easier to load (no more ResourceManager!), and that RESX files can be autocompiled simply by placing them in the application’s Resources directory. The <asp:localize runat=”server”> element allows blocks of text to be localized using string resources.
PROVIDERS:-
New model for storing and managing state
-
- Makes storage adaptable to different media
Used by many key ASP.NET services
-
- Membership service
- Role Management service and more
Built-in providers make ASP.NET state storage very flexible
Custom providers make it infinitely flexible
Most ASP.NET 2.0 state management services use a new model called the “provider model” to make state storage infinitely flexible. In the provider model, a service doesn’t manage state by interacting directly with a data store; instead, it uses a provider. The model is highly extensible because if the providers shipped with the system aren’t sufficient for your needs—if, for example, you want to store membership data or session state in an Oracle database rather than SQL Server—then you can plug in custom providers that target Oracle data stores. Developers can write custom providers themselves or acquire them from third parties

This is one specific example of the provider model–the one used by the Membership service. The application talks to the Membership service through classes such as Membership and MembershipUser. These classes, in turn, read and write membership data by calling a provider. (Each class has a property named Provider that identifies the associated provider.) Each provider interfaces with a particular type of data store. If none of the providers supplied with the Framework supports the data store you wish to use (for example, an Oracle database), you can write a provider of your own or acquire one from a third party. The Membership service is one of several services that are provider-based.
CONFIGURATION:-
Administrative tools
- ASP.NET MMC snap-in
- Web Site Administration Tool (Webadmin.axd)
Configuration API
- Read/write access to configuration settings
- Simplified custom configuration sections
Instrumentation
- Perf counters, health monitoring, and more
In ASP.NET 1.x, editing configuration settings meant manually modifying XML configuration files. In 2.0, two new tools–the ASP.NET MMC snap-in and the Web Site Administration Tool–enable most configuration settings to be applied through administrative GUIs. Both tools represent significant enhancements in usability and should prove especially valuable to admins responsible for managing remotely hosted ASP.NET Web sites.
ASP.NET 2.0’s configuration API fills a hole in ASP.NET 1.x by providing an easy-to-use and extensible API for reading and writing configuration settings. Applications can now read their own configuration settings without parsing raw XML, and they see a merged view of those settings that includes settings inherited from configuration files higher in the directory hierarchy. Moreover, writing configuration settings is as easy as reading them, and implementing custom configuration sections requires little more than deriving from System.Configuration.ConfigurationSection.
ASP.NET 2.0 is also far more heavily instrumented than 1.x. Thanks to the new health monitoring subsystem, a few simple statements in Web.config can configure an application to write an entry to the Windows event log when a login fails, e-mail a system administrator when an unhandled exception occurs, and more. In addition, you can extend the health monitoring subsystem by defining Web events of your own. Other enhancements in this arena include new performance counters supplementing the ones in ASP.NET 2.0, integration with ETW for high-performance end-to-end tracing of requests as they travel through the system, and new options for generating, capturing, and managing trace output.
WEB PARTS:-
Framework for building portal-style apps
- Patterned after SharePoint Portal Server
- System.Web.UI.WebControls.WebParts
Rich UIs with minimal code
- Edit page layout using drag-and-drop
- Edit appearance and behavior and more
Seamless personalization
Intercommunication (“connections”)
Web Parts is a framework built into ASP.NET 2.0 for building highly customizable portal-style pages. End users can customize Web Parts pages by changing the page layout, adding and removing Web Parts, editing Web Parts properties, establishing connections between Web Parts, and more. Changes made to a Web Parts page are persisted by the Web Parts framework. Web Parts pages exhibit a degree of sophistication seldom seen in Web applications today, and they do it without requiring you to write reams of code. In fact, as with many of the other new features in ASP.NET 2.0, the vast majority of what you can accomplish with the Web Parts can be accomplished declaratively.
What’s New in Compilation:-
Autocompile anything
-
- CS files, VB files, RESX files, and so on
- Simply drop files into special directories
- Extensible with custom build providers
New code-behind model (code-behind 2.0)
-
- Fixes fragilities in version 1
- Relies on partial class support in compilers
Precompile and deploy without source
ASP.NET 1.x was capable of autocompiling pages (ASPX files), but CS files, VB files, RESX files, and other file types had to be compiled manually. ASP.NET 2.0 extends the autocompilation model to include a variety of file types. Rather than compile a ShoppingCart class and place the resultant assembly in the bin directory, for example, you can simply copy the CS file containing the ShoppingCart class into the Code directory and let ASP.NET compile it for you.
ASP.NET 2.0 also permits Web sites to be precompiled to avoid compilation delays the first time a page is accessed. Along with precompilation comes a new feature that allows sites to be precompiled AND deployed without source code. Deploying without source code is useful when you allow a third party to host your site but want to keep the source code in-house.