Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.


Channels ▼
RSS

ASP.NET 2.0 Highlights


ASP.NET 2.0 Highlights

A few weeks ago, Microsoft announced a new version of ASP.NET and revealed some of its hottest features. ASP.NET 2.0 is part of the new version of the .NET Framework—codenamed Whidbey—and will be 100 percent compatible with previous versions, both 1.0 and 1.1. First and foremost, ASP.NET 2.0 introduces no breaking changes and provides side-by-side compatibility with existing versions. At this time, the platform is available in alpha version (shipped at PDC) and will enter a public beta testing phase in a few months.

The first thing to note is that ASP.NET 2.0 continues on the way already plotted by its predecessor—reducing the lines of code needed to set up an application. Several operations in ASP.NET 1.x required considerable programming efforts, most of which were not to implement complex functions but just boilerplate code. ASP.NET 2.0 significantly reduces the quantity of code to write and buries much of the needed code in a new bunch of classes. This is particularly true for data binding where the new data source model works in conjunction with new data-bound controls and provides codeless data binding. In addition to increased productivity, ASP.NET 2.0 aims at simplification of the web administration and targets lots of mobile devices with a common object model.

ASP.NET 2.0 comes with a long list of features although the overall architecture is roughly the same. It provides new user interface features such as Web Parts, master pages, and themes; a new family of controls for security (login, password recovery); personalization and membership; and a new and improved model of data binding. Let’s take a closer look at two of them—master pages and the data source object model.

A large number of web sites these days contain similar-looking pages that share the same header, footer, and perhaps some navigational menus or search forms. If you wrap these user interface elements in user controls and reference them in each page, you have a model that works but it soon becomes unmanageable as the number of pages grows. On purpose, ASP.NET 2.0 introduces master pages. A master page is a distinct file referenced at the application, as well as the page, level that contains the static layout of the page. A master page contains regions that each “derived” page can customize. A derived page is the collection of blocks that the runtime will use to fill the holes in the master. Master pages promotes page reusability but is not based, nor does it exploit, class inheritance. Finally, the binding between master and content pages is defined statically and cannot be changed or set programmatically.

ASP.NET 2.0 simplifies the data binding mechanism introducing a new family of data components—the data source components—that in turn support a declarative model of binding. The data source control represents a source of data that returns and accepts data over a well-known stream—such as SQL, XML, DataSet, and custom formats such as the Microsoft Exchange Inbox or Microsoft Excel worksheets. At least for relatively common fetch-display-edit scenarios, data source objects offer a very approachable schema for any web developer and a time-saving resource for more seasoned programmers. All existing data-bound controls support the new data source model. Likewise do new data-bound controls such as the GridView and the DetailsView. The key advantage of data source objects is that they provide data management capabilities to user interface controls so that these controls can connect to back-end data sources. The interconnection takes place quite magically as the user interface controls and the data provider are unaware of each other.


Dino Esposito is Wintellect's ADO.NET and XML expert, and a trainer and consultant based in Rome, Italy. Dino is a contributing editor to Windows Developer Network and MSDN Magazine, and the author of several books for Microsoft Press including Building Web Solutions with ASP.NET and ADO.NET and Applied XML Programming for .NET. Contact Dino at [email protected].


Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.