ASP.NET 3.5 Extensions Preview - Dynamic Data Controls

Earlier I had blogged about ASP.NET 3.5 Extensions Preview  and also the Dynamic Data Controls and how ASP.NET would be evolving into a comprehensive platform for rapid applicaiton development of Data Driven Websites.

While the earlier preview I talked about (Dynamic Data Controls) was a part of the ASP.NET "Futures" CTP, there is now a much better build of the Dynamic Data Controls which we shipped as a part of ASP.NET 3.5 Extensions Preview.

Simply putting, we would encourage you to try out the new Dynamic Data Controls that were shipped as a part of ASP.NET 3.5 Extensions Preview rather than the one that was shipped with ASP.NET "Futures" July 2007 CTP.

So, if you are working with ASP.NET 3.5 and Visual Studio 2008, I would recommend you uninstall the ASP.NET "Futures" July 2007 CTP from "Add/Remove Programs" and install ASP.NET 3.5 Extensions Preview from ASP.NET Extensions Preview Website  Once you install the same, you get a new "Dynamic Data Website" template, when you select "File - New - Website" in Visual Studio 2008.  This one has a wizard icon attached to it, or occasionally has a blank icon, so you can easily distinguish this template from the old "Dynamic Data Website" template shipped with ASP.NET "Futures" July 2007 CTP, just in case you hadnt uninstalled the same.

Ok, once you select the new "Dynamic Data Website" and create a website, you will be seeing a bunch of files created automatically.

To begin with, we will just use the existing templates and create a Data bound website quickly.  So, the first step in creating a Data Driven Website is to design the Data Access Layer.  To do that, select "Add - New - Item" and choose "Linq to SQL Classes" and provide a name say "Northwind.dbml".

Once the Linq to SQL file is created, open Server Explorer, connect to your Database instance.  Thereafter you can expand the "Tables" node and drag and drop a few tables into the Linq to SQL Visualizer.

Say, let us pick up the following tables

Products, Customers, Orders and Order_Details

The next step is just to build the solution and then your Data Access Layer built using LINQ to SQL is ready.   You could customize, modify all the code that is auto generated using the file Northwind.designer.cs but make sure you take care that you dont regenerate this file since it would wipe off all your customizations.

The next step would be expanding your web.config file and locating the setting "enableTemplates" property of <dynamicData> tag to "true".  Note that by default this is set to "false".

Thats it, you would be able to run the site and get the Default Page with a nice menu control linking to all the pages corresponding to the tables you had selected.

You could change the URL pattern, provide a different name, edit templates and do all other stuff with the auto-generated files and controls.

But to begin with, it provides you a full fledged funtional site with data in different formats, GridView, DetailsView, InsertTemplate, Filter etc., all of them AJAX Enabled.  If you had worked with the Dynamic Data Controls of the earlier build (ASP.NET "Futures" July 2007 CTP) you would have noticed that all the controls used in that build are in much better shape and AJAX Enabled too.

Cheers !!!

Print | posted on Monday, January 28, 2008 10:06 PM

Comments on this post

# re: ASP.NET 3.5 Extensions Preview - Dynamic Data Controls

Requesting Gravatar...
what visual studio needs is a true data centric language as part of visual studio not more freaking wizards. Why cant microsoft really help us out with data base web applications by implementing foxpro's core functionality into visual studio either as a name space or a language. VFP was the ONLY microsoft product that handled data correctly.

Mark

Left by Mark Gordon on Feb 04, 2008 11:54 AM

# re: ASP.NET 3.5 Extensions Preview - Dynamic Data Controls

Requesting Gravatar...
Do you have any insight on how to reduce loading and perhaps install caching with these controls? I'm on shared hosting and starting to see heavy cpu use.
Left by Combi Boiler on Sep 29, 2010 6:30 PM

Your comment:

 (will show your gravatar)