다음을 통해 공유


Dynamic Data Resources

Thanks to all that turned out at the ASP.NET Professionals User Group tonight in Waltham to hear about ASP.NET Dynamic Data.  As promised, I’m listing the resources I provided on my closing slide here, and I’ll provide a few pointers to answer some of the questions in a little more detail as well.

Resources

https://asp.net/dynamicdata – main site, including “How Do I” videos

ASP.NET Dynamic Data 4.0  Preview 3

  • vNext sample – incorporates functionality targeted for the Dynamic Data 4.0 release (coinciding with .NET 4.0), but compiled with 3.5 SP1 bits, so you can experiment with the functionality now
  • Futures project – additional functionality to extend the current release including support for advanced filtering and the application of metadata at runtime

Design for Data – Dan Crowell’s community repository of CSS styles for Dynamic Data

Blogs

Screencast and slides/demo from a previous version of the presentation I gave tonight

Questions

Q.  How can I control what properties/columns appear in display mode versus edit mode?  For instance, we added a composite ‘fullname’ property for the List view, but we needed the individual first name and last name field on the edit view.

A.  To handle this you’ll have to do a little bit of coding; Stephen Naughton’s blog post will lead you through this.  The gist of the solution is that you create a new attribute to specify the conditions under which the affected properties/columns should be displayed.  Secondly, you implement your own customized field generator (interface IAutoFieldGenerator) to examine the attribute and either include or exclude the property/column from the GridView, DetailsView, ListView, etc.

Q.  Can I use mechanisms other than ASP.NET membership to specify roles and permissions for accessing or updating specific properties in the model?

A.  You can pretty much do whatever you want using a combination of custom attributes and injecting a bit of code at appropriate access points.  Stephen has a great series of posts that provides a lot of detail in setting up an access scheme, one that could leverage the existing ASP.NET membership infrastructure or a mechanism of your own choosing.

Q.  Are there any books on ASP.NET Dynamic Data?

A.  The only one I found was a Wrox Blox PDF, a 34-page downloadable e-book.  I also have the following ASP.NET 3.5 books on hand,

but only the latter even mentions Dynamic Data, and doesn’t do much more than describe the feature.  Granted, Dynamic Data was part of the 3.5 Service Pack 1 release, so many of these books may have already been in the publication phase before the feature was nailed down.  There is also Programming ASP.NET 3.5, but I don’t have that one handy, so not sure what coverage there is of Dynamic Data.

Hmm, perhaps it’s an opportunity for you to be the next great American author!