Microsoft ASP.NET 3.5 Extensions Preview Released

Today we released the ASP.NET 3.5 Extensions Preview which contains lots of the new things the ASP.NET team is working on. Here is a brief list of items:

- Dynamic Data: This is extensions to existing Data Controls allows them to generate much more code for you automatically based on the data model and meta data that is attached to the model.

- MVC: This is a new form of ASP.NET web development which gives the web developer much more control over the markup and provides a cleaner separation between presentation/logic/data.

- Silverlight Controls: This is a simple ASP.NET server control that makes adding Silverlight support a snap. It includes themes, automatic installation of Silverlight, client and server events.

- AJAX: New extensions have been added to the Ajax library to support managing browser history when using UpdatePanels. This means making the back button behave right when using Ajax.

- Entity Framework: A new data modeling framework that allows conceptual mapping. You create your object model and map it to your database tables as you see fit.

- Astoria: A new data service for exposing data and services via REST based URL. Ajax client side script library and server side data source control is provided to access these services from ASP.NET.

 

Here is a link to download the bits from the ASP.NET site.

 

I'm lucky to be the program manager on the Dynamic Data and ASP.NET Astoria DataSource control. Over the next few weeks I plan on releasing samples and a walkthrough tutorial on building applications with these new features.

 

For starters I want to give a detailed description of what Dynamic Data is. Today if you build an application with say an GridView control our tools will generate the default columns and you get no validation, no easy way to replace the look and feel of a column without reverting to creating templates for insert/update/delete.

 

In the case of Dynamic Data lets say I have the following on my page:

<DyanamicGridView id="DynamicGridView" runat="server" DataSourceID="LinqDataSource1" />

<asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="NorthwindDataContext" TableName="Products"></asp:LinqDataSource>

 

1. If a column is marked as not nullable in the data model, we automatically provide validation to enforce the column is filled in.

2 If a column is a string and has a length of 20, we will limit input in the textbox for that field to 20 characters.

3. If a column is a datetime, integer or floating point value we will automatically enforce that data entered in these columns is legal for the specified column.

4. If a column is a foreign key we will automatically lookup the text property for the field in the foreign key table and display it instead of the ID. In the case of editing we will automatically create a dropdown list that contains the values from the foreign key table. Plus we can make the column clickable if you want it to link to the foreign key table.

 

You get all this for free without writing any code. At the same time we  provide a ton of extensibility hooks:

1. We have attributes that can be placed directly on the data model to control validation and display formation. For example we have Required, Range, Regex, DisplayFormat attributes that when applied to the data model will affect any page that uses Dynamic Data.

2. We have field templates with provided source code. Field templates are the controls used to render a specific data type in a control. In the past our controls just rendered things internally and you had no way to override the behavior other then creating templates for View/Insert/Update which is very time consuming and error prone when you have many pages. Now you can change the default field templates for each data type or create your own and map them to a table via meta data attributes on the data model.

 

And on top of all of that we provide a scaffold as well where we dynamically build and entire set of pages based on your data model. These can be overrided using global page templates or on a particular table based on a simple ASP.NET page.

 

All of these cool features work on both the traditional ASP.NET webforms or the cool new MVC framework that is also included in the Extensions Preview release.

 

I hope to start my tutorial and demos on this blog tomorrow. Stay tuned!