skip to the main content area of this page
Patterns and Practices

 

ASP.NET MVC Gets IDataErrorInfo and UI Code Generation / Scaffolding Support


Scott Guthrie mentions that the ASP.NET MVC Framework has support for IDataErrorInfo and code generation / scaffolding.

 

ASP.NET MVC and T4 Templates

I have mentioned T4 Templates quite a bit. ASP.NET MVC takes advantage of T4 Templates to provide a bit of UI Scaffolding and Code Generation to help with generating various View Templates. Here is an image I shamefully snagged from Scott Guthrie ( because the release candidate has not been released yet ) showing the UI Code Generation to be included in the ASP.NET MVC Release Candidate in 1Q2009:

 

ASP.NET MVC Code Generation

 

In particular, you can specify the type of View you are generating and the MVC Framework will use T4 Templates to generate the code in the view to edit a product in this case.

 

ASP.NET MVC and IDataErrorInfo

Scott also mentions that the ASP.NET MVC Release Candidate will support IDataErrorInfo for displaying errors in the ASP.NET MVC Framework. This will be ideal for displaying errors with the help of the Enterprise Library Validation Application Block that I mention here:

 

Per Scott:

"There are many other features and requests coming with the RC as well including: IDataErrorInfo support to enable models to surface validation error messages, as well as richer error validation extensibility to enable you to use your own approach to surface model validation errors to ModelBinders (the IDataErrorInfo support is built on top of this); new FileResult and JavaScriptResult ActionResult types (allowing you to more easily download files as well as executable JavaScript to browsers); built-in jQuery -vsdoc intellisense support; refactored AccontController support to enable easier unit testing and extensibility with form login scenarios; a variety of project template improvements, more extensibility everywhere; lots of bug fixes; and a few other cool features I'll blog about later once the RC is out.

We'll be releasing the ASP.NET MVC Release Candidate in January. Our plan is to have that build be ASP.NET MVC V1 API and feature-complete and have zero known bugs.  We'll give people a short period to upgrade to it, give it a good tire-kicking, and report any last minute issues they find.  We'll then ship the official V1 release shortly after that (so not far off now)."

Very cool!

 

ASP.NET MVC Tutorials


Tags: MVC, T4


Topics



 

Popular Tags



Recent Links