Download - ASP.NET Dynamic Data
![Page 2: ASP.NET Dynamic Data](https://reader036.vdocument.in/reader036/viewer/2022062411/568166b0550346895ddaaaf2/html5/thumbnails/2.jpg)
Code Name 'Oryx' Web application scaffolding
Easy to dynamically display pages based on the data model of the underlying database
Easy to edit data for admin appsHelps in prototyping systems quicklyOut of the box simple to use or can be very
customized
What is it?
![Page 3: ASP.NET Dynamic Data](https://reader036.vdocument.in/reader036/viewer/2022062411/568166b0550346895ddaaaf2/html5/thumbnails/3.jpg)
Uses LINQ to SQL to build a Data model.Uses DynamicData Controls to build editable
screens.Builds in Paging, Sorting, Filtering, and
Validation automatically.Dynamic Data fields for rendering individual
data types.Allows a great deal of customization.
What does it do ?
![Page 4: ASP.NET Dynamic Data](https://reader036.vdocument.in/reader036/viewer/2022062411/568166b0550346895ddaaaf2/html5/thumbnails/4.jpg)
Let's do it
![Page 5: ASP.NET Dynamic Data](https://reader036.vdocument.in/reader036/viewer/2022062411/568166b0550346895ddaaaf2/html5/thumbnails/5.jpg)
ASP.NET 3.5 Extensions CTP
(http://www.asp.net/Downloads/3.5-extensions)
Visual Studio 2008
What do I need to use it?
![Page 6: ASP.NET Dynamic Data](https://reader036.vdocument.in/reader036/viewer/2022062411/568166b0550346895ddaaaf2/html5/thumbnails/6.jpg)
Subsonic (free)Django (free but Python)ASP RunnerIron Speed Designer
Products that are similar
![Page 7: ASP.NET Dynamic Data](https://reader036.vdocument.in/reader036/viewer/2022062411/568166b0550346895ddaaaf2/html5/thumbnails/7.jpg)
ASP.NET 3.5 Extensions CTP has a lot in itASP.NET Dynamic DataADO.NET Data Services (formerly codename
Astoria)ASP.NET Model View Controller ApplicationsASP.NET AJAX
Managing Browser History Using Server Controls ASP.NET Silverlight contolsADO.NET Entity Framework
What comes in the box?
![Page 8: ASP.NET Dynamic Data](https://reader036.vdocument.in/reader036/viewer/2022062411/568166b0550346895ddaaaf2/html5/thumbnails/8.jpg)
ListTemplate.aspx - Grid to edit inline or call from a link to a detail page.
DetailsTemplate.aspx – Edit one record on a page.
ListDetailsTemplate – Both a grid and an a detail editor (default).
Same Routing engine as MVC.
Built in Dynamic Data Pages
![Page 9: ASP.NET Dynamic Data](https://reader036.vdocument.in/reader036/viewer/2022062411/568166b0550346895ddaaaf2/html5/thumbnails/9.jpg)
Let's look @ the templates + Web.config
![Page 10: ASP.NET Dynamic Data](https://reader036.vdocument.in/reader036/viewer/2022062411/568166b0550346895ddaaaf2/html5/thumbnails/10.jpg)
DynamicGridView
DynamicDetailsView
DynamicFormView
DynamicListView
Dynamic View Controls
![Page 11: ASP.NET Dynamic Data](https://reader036.vdocument.in/reader036/viewer/2022062411/568166b0550346895ddaaaf2/html5/thumbnails/11.jpg)
DynamicField - Automatically knows what mode Dynamic view is in (Edit, Item, Insert) for use with DynamicGridView DynamicDetailsView
DynamicControl, DynamicEditControl, and DynamicInsertControl – Dynamic fields to be used with templated view controls Template columns in a DynamicGridView DynamicFormViewDynamicListView
Dynamic controls
![Page 12: ASP.NET Dynamic Data](https://reader036.vdocument.in/reader036/viewer/2022062411/568166b0550346895ddaaaf2/html5/thumbnails/12.jpg)
Customizations as easy as making a new partial class.
Allows unique behavior for a particular table
Trick out my grid
![Page 13: ASP.NET Dynamic Data](https://reader036.vdocument.in/reader036/viewer/2022062411/568166b0550346895ddaaaf2/html5/thumbnails/13.jpg)
DisplayFormat - formats for currency, dates, etc…
DisplayColumn – Allows a text column other than the 2nd column in the fk to describe the ID
Formatting by decorating
![Page 14: ASP.NET Dynamic Data](https://reader036.vdocument.in/reader036/viewer/2022062411/568166b0550346895ddaaaf2/html5/thumbnails/14.jpg)
Demo using formatting attributes
![Page 15: ASP.NET Dynamic Data](https://reader036.vdocument.in/reader036/viewer/2022062411/568166b0550346895ddaaaf2/html5/thumbnails/15.jpg)
[Range("UnitsInStock",10,50, ErrorMessage="Must be between {1} and {2}")]
[Required("ContactName", ErrorMessage = "Contact name is required.")]
[Regex(“ssn", "[0-9][a-z][0-9]", ErrorMessage = "Needs to be formatted as 'number letter number'")]
Validation by decoration
![Page 16: ASP.NET Dynamic Data](https://reader036.vdocument.in/reader036/viewer/2022062411/568166b0550346895ddaaaf2/html5/thumbnails/16.jpg)
Demo using validation attributes
![Page 17: ASP.NET Dynamic Data](https://reader036.vdocument.in/reader036/viewer/2022062411/568166b0550346895ddaaaf2/html5/thumbnails/17.jpg)
LINQ to SQL classes are generated with hooks for events that are normally not implemented
Lightweight event notification
New feature new to .NET 3.5 called partial methods
Like partial classes, but used to extend methods that may or may not be implemented in class instance (can be seen in Northwind.designer.cs)
Validation by notification
![Page 18: ASP.NET Dynamic Data](https://reader036.vdocument.in/reader036/viewer/2022062411/568166b0550346895ddaaaf2/html5/thumbnails/18.jpg)
Demo validation using partial method
![Page 19: ASP.NET Dynamic Data](https://reader036.vdocument.in/reader036/viewer/2022062411/568166b0550346895ddaaaf2/html5/thumbnails/19.jpg)
By default Dynamic Data Fields try to match the rendering of a control with one of the built in Control Templates:Boolean.ascxBoolean_Edit.ascxDateTime.ascxDateTime_Edit.ascxInteger_Edit.ascxDecimal_Edit.ascxMany More
Built in Control templates
![Page 20: ASP.NET Dynamic Data](https://reader036.vdocument.in/reader036/viewer/2022062411/568166b0550346895ddaaaf2/html5/thumbnails/20.jpg)
Simple .ascx filesWhen code is modified all controls behavior
will be affected globally.Can perform global validation here as wellExample Calendar
Replacing Built in Control templates
![Page 21: ASP.NET Dynamic Data](https://reader036.vdocument.in/reader036/viewer/2022062411/568166b0550346895ddaaaf2/html5/thumbnails/21.jpg)
Look @ the templates and modify one
![Page 22: ASP.NET Dynamic Data](https://reader036.vdocument.in/reader036/viewer/2022062411/568166b0550346895ddaaaf2/html5/thumbnails/22.jpg)
[RenderHint] enables you to build a custom control that can be explicitly linked to a field.
Simple as validationBecause it is a user control there can be
multiple controls that can speak to each other.
Can use Ajax Toolkit to use helpful extenders right out of the box
Customized controls work regardless of which view is beieng used (i.e. DynamicGridView, DynamicListView, etc…)
Customization by decoration
![Page 23: ASP.NET Dynamic Data](https://reader036.vdocument.in/reader036/viewer/2022062411/568166b0550346895ddaaaf2/html5/thumbnails/23.jpg)
Make our own custom control (courtesy of David
Ebbo)
![Page 24: ASP.NET Dynamic Data](https://reader036.vdocument.in/reader036/viewer/2022062411/568166b0550346895ddaaaf2/html5/thumbnails/24.jpg)
Don’t have to work with a Page Template we can build stand alone pages that use dynamic data
Requires a little more work.Need to make some manual changes…for
now
Look Ma; no PageTemplates!!!
![Page 25: ASP.NET Dynamic Data](https://reader036.vdocument.in/reader036/viewer/2022062411/568166b0550346895ddaaaf2/html5/thumbnails/25.jpg)
Newest template based control has dynamic counterpart.
Has the benefits of a GridView, but allows full control of rendering.
Interesting wizards to help setup the template in interesting ways.
The ListView Rocks!!!
![Page 26: ASP.NET Dynamic Data](https://reader036.vdocument.in/reader036/viewer/2022062411/568166b0550346895ddaaaf2/html5/thumbnails/26.jpg)
Roll our own ListView Page
![Page 27: ASP.NET Dynamic Data](https://reader036.vdocument.in/reader036/viewer/2022062411/568166b0550346895ddaaaf2/html5/thumbnails/27.jpg)
David Ebbo: http://blogs.msdn.com/davidebb/archive/2007/12/12/dynamic-data-screencast-is-now-available.aspx
Brad Abrams: http://blogs.msdn.com/brada/archive/2007/12/13/asp-net-3-5-extensions-all-about-dynamic-data.aspx
David Hayden: http://davidhayden.com/blog/dave/
Scott Guthrie: http://weblogs.asp.net/scottgu/archive/2007/12/14/new-asp-net-dynamic-data-support.aspx
Links
![Page 28: ASP.NET Dynamic Data](https://reader036.vdocument.in/reader036/viewer/2022062411/568166b0550346895ddaaaf2/html5/thumbnails/28.jpg)
Q +A