Connect with life Sundararajan Subramanian SDE | Microsoft R&D India Pvt Ltd.,
Session Summary Introducing Dynamic Data Customization Options Demos Feedback and Q&A
The traditional approach Create your model Create ASP.NET pages Add data controls and data source controls Add validation logic in the page Issues: Fair bit of work to get started Logic lives in the wrong place Ignores valuable schema information Reuse and customization is difficult
The Dynamic Data approach Create your model Instantly get a fully functional app! Customize the app piece by piece: Model Fields Pages Routes
Dynamic Data At a Glance
Meta Model Register contexts/providers Get Tables/Path Dynamic Data Folder Virtual Path Field Template Factory Meta Model Meta Table Meta Column Meta Table Meta Column URL Generation
Routing Pipeline URL Routing Module URL Routing Module Dynamic Route Dynamic Route Route Table ASPX Page Dynamic Route Handler Dynamic Route Handler Request Response Ensures: 1) Table 2) Action Checks for: 1) Custom Page 2) Scaffold Page
UI Customization Dynamic Data provides UI customization at many levels (from least to most control) PageTemplatesFieldTemplatesUIHint/DataType on ModelCustomPagesUIHints on DynamicField/DynamicControl
Annotating the model Metadata on model drives the behavior Default metadata inferred from schema Data types and relationships Required fields, string length, … Add additional metadata Validation Field labels and descriptions Partial methods
Annotating the model
Field templates Fields are rendered using templates Selected based on field data type Handle rendering, data binding and validation Template selection can be overridden Can be overriden with DataType and UIHint attributes or properties Simple ascx files that can easily be reused across projects
Field templates
Customizing pages Page templates Affect shared behavior across tables Custom pages for individual tables Choose the column set Customize the rendering
Dynamic Data Controls DynamicDataManager GridView, DetailsView DynamicDataField ListView, FormView DynamicControl LinqDataSource, EntitiesDataSource DynamicControlParameter DynamicQueryStringParameter DynamicValidator DynamicFilter (UserControl), FilterRepeater
Customizing pages
Dynamic Data Wizard
Final thoughts Try the.Net 3.5 SP1 today Update the DynamicData with the preview available in CodePlex Forum: Blogs:
Feedback / QnA Your Feedback is Important! For detailed feedback, use the form at Or us at Use the Question Manager on LiveMeeting to ask your questions now!
Contact Blog Address
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.