Introducing the new Dynamic Data

Today, we released the ASP.NET 3.5 Extensions Preview, which includes the exciting Dynamic Data feature.

A lot has happened since we released an early version of Dynamic Data Controls in the May ASP.NET Futures release.  While it was already an exciting feature, it was not very customizable and was limited to a small set of scenarios.

While this new version preserves the essence of the original, it is also completely different.  Not only it addresses the limited customization, but it also brings a lot of new things.

Since most of you are likely new to Dynamic Data, let me start with a quick introduction of what it is about.  The core purpose is to make it easy to write powerful and extensible data driven web application.  Here are some of the steps involved (not all of them are necessary):

  1. Define your model: this step is not specific to Dynamic Data, but this is where it all starts.  You have a database, and you create a model for it.  Currently, this is done using Linq to SQL.  In the future Linq to Entities will be supported as well.
  2. Test a scaffolded version of your app: with no additional effort, Dynamic Data lets you run a scaffolded web application on top of your schema.  Although this scaffold has a 'standard' UI, it lets you try all CRUD operations on your tables.  Furthermore, it has full support for relationships.  For instance (assuming Northwind), the Products page would let you navigate to a product's category info, and editing a Product's category would show you a rich drop down with category names (instead of IDs).
  3. Customize the shared page views: you then get to make changes to the page templates that are used to display the scaffolded views.  That, you can make changes that will affect the view of all the tables.
  4. Customize the specific pages: the next step is to define some custom UI for specific pages.  e.g. you could write one of Products and another for Categories.  The nice thing is that while you do this, you still get the standard scaffolded view for all the other tables.  This lets you create specfic pages at your own pace, while keeping a functional application at every point.
  5. Annotate your model: you can add attributes to your model to add extra knowledge about certain fields.  e.g. you could set a Range on the product's UnitsInStock field so it only allows values between 0 and 50.  The UI would then automatically pick this up and validate inputs accordingly.  The great thing is that you are keeping this information on your model, and don't need to 'pollute' your pages with it.
  6. Create custom field templates: all fields in Dynamic Data are rendered via field templates, which are basically user controls.  You can also create custom templates, which can be very powerful.  e.g. in the above case, you could create a field template that renders a range as a slider control instead of a textbox.  Again, your page would pick that up without you having to add this custom UI directly in the aspx file.

Well, this should be enough for a quick introduction.  I'll try to have a screencast available tomorrow, which will run through some of the basic scanerios.  I'll then follow up with more specific posts and screencasts that go deeper into specific areas.

To ask questions or report issues about this feature, please use this ASP.NET forum .