Scott Hanselman

Hanselminutes on 9 - ASP.NET MVC 2 Preview 1 Released

July 31, 2009 Comment on this post [5] Posted in ASP.NET | ASP.NET MVC | Channel9 | Podcast
Sponsored By

Virtual Scott HanselmanI was up in Redmond this week and stopped by to visit my Video Portal in Phil's Office. I wanted to see where I virtually sit.

While I was there, Phil gave me/us/you a tour of ASP.NET MVC 2 Preview 1.

Be sure to read ScottGu's post on ASP.NET MVC 2. The best point:

  • Today’s preview works with .NET 3.5 SP1 and VS 2008, and can be installed side-by-side on the same machine as ASP.NET MVC 1.0 (meaning they don’t conflict and your existing ASP.NET MVC 1.0 projects will not be impacted if you install it).

Quoting from the ASP.NET MVC Roadmap, the theme for ASP.NET MVC 2 is "Improved Productivity and Enterprise Ready."

ASP.NET MVC 2 Features

Preview 1 - Early August

  • Templated Helpers - allow you to automatically associate edit and display elements with data types. For example, a date picker UI element can be automatically rendered every time data of type System.DateTime is used. This is similar to Field Templates in ASP.NET Dynamic Data.
  • Areas - provide a means of dividing a large web application into multiple projects, each of which can be developed in relative isolation. This helps developers manage the complexity of building a large application by providing a way to group related controllers and views.
  • Support for Data Annotations - Data Annotations enable attaching validation logic in a central location via metadata attributes applied directly to a model class. First introduced in ASP.NET Dynamic Data, these attributes are now integrated into the default model binder and provide a metadata driven means to validating user input.

Preview 2 and beyond

  • Client Validation - builds on top of the Templated Helpers and Data Annotations work done in Preview 1 to provide client-side validation based on the model's validation attributes. This provides for a more responsive experience for users filling out a form with validation.
  • Strongly-typed input helpers – allow generating form input fields using code expressions against the model. This allows the helpers to take advantage of Data Annotations attributes applied to the model and reduces errors caused by lack of strong typing such as typos.
  • Strongly-typed link helpers – allow developers to take advantage of Intellisense support (due to the strong typing) to discover which controllers and actions are available for linking.
  • Asynchronous Controller Actions - provides a programming model for writing actions that can call external resources without blocking a thread. This can increase the scalability of a site that needs to interact with web services and other external services.
  • Areas - continued refining of the Areas feature, enabling a single project approach for developers who wish to organize their application without requiring multiple projects.
  • Other Improvements - continue to fix known issues carried over from ASP.NET MVC 1.0 as well as ASP.NET MVC 2 Preview 1. Also including API improvements based on user feedback along with minor new features.

There's lots of cool stuff (release notes are here) and in this video Phil shows off Templated Helpers. There's a walkthrough of Templated Helpers in the Pre-Release Documentation as well.

Remember, it's a preview, so there's still time to give feedback. Blog about it, complain in the forums, or bug us on Twitter.

I hope you enjoy the video!

Related Links

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Hosting By
Hosted in an Azure App Service
July 31, 2009 12:43
Fantastic news!!! How about strongly-typed action generators? :( (to strongly-type the controller and action name)
July 31, 2009 14:44
Well I guess I got an answer to this..


That is on the list for future previews. We have been playing around with a few different approaches and are trying to figure out which approach feels best.

Thanks,

Scott


I am really looking forward to this as it will make the code more refactor-friendly. :)
July 31, 2009 16:24
One sucky thing with action generator is that I have some (not a lot, but more than a few) that the method parameters and routing parameters don't match at all due to model binding or action filters. I don't see how those could be done via lambdas?
August 03, 2009 11:18
Oh man... what can I say? The capability to split my project into areas, get simple server-side AND client-side validation at once (using the fabulous jQuery validation plugin none-the-less), templated Html helpers...

Ugh... makes me wish I had MVC 2 for the current project I'm building. Looks like I may have to totally rewrite it once MVC 2 is out - so much goodness. ;D
September 07, 2009 16:48
how to learn easily mvc on internet
send me answer to
anirudhakumar.gupta@gmail.com

Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.