Last post Jun 03, 2010 05:23 AM by sjnaughton
Jun 02, 2010 04:10 PM|davidshq|LINK
I'm wondering if someone can quickly explain to me the benefits of using Dynamic Data behavior in an existing ASP.NET 4.0 application say on a GridView?
Jun 02, 2010 07:52 PM|PeteNet|LINK
You should be able to get an overview from the docs itself:
Using Dynamic Data in ASP.NET Apps, to quote:
When you enable Dynamic Data for data-bound controls, you get the following benefits:
Setting default values for data fields. Dynamic Data enables you to provide default values at run time for fields in a data control.
Interacting with the database without creating and registering a data model. Data-bound controls that support Dynamic Data can interact with the database by using any data source, without scaffolding. This avoids having to configure a LINQ to SQL or Entity
Framework data model and use the LinqDataSource and
Automatically validating the data that is entered by the user without writing any code.
These classes: DynamicDataManager, DynamicControl and DynamicField allow you to perform tasks not available in the regular GridView (as you'll see on that page).
Jun 03, 2010 05:23 AM|sjnaughton|LINK
You get the most from Dynamic Data by have your model registered in Global.asax, although you can use dd in single pages by regitering an entity like:
You will not get Foreign key relationships shown this way, you will only get the nice relatiuonship dropdown lists when you register the model with DD in the Global.asax. You don't need to use it fully scaffolded when you do it this way you can still build
your page in the standard webforms way but by using DynamicControl and DynamicField in place of DataBoundControl and DataBoundField you will get all the DD features inc foreign key relationships. see my articles here: