Microsoft Delivers ASP.NET MVC V2 Preview

Microsoft releases a preview of Version 2 of its ASP.NET MVC Web application development system.

Microsoft on July 31 released a preview of Version 2 of its ASP.NET MVC Web application development system.

In a blog post on the release, Scott Guthrie, corporate vice president of Microsoft .NET Developer Platform, said the new ASP.NET MVC V2 preview works with .NET 3.5 Service Pack 1 and Visual Studio 2008, and "can be installed side-by-side on the same machine as ASP.NET MVC 1.0."

Microsoft released an initial version of ASP.NET with MVC (model-view-controller) support in December 2007. MVC is an architectural pattern used primarily in the Java world, and perhaps used most famously in the Ruby on Rails framework. MVC decouples data access and business logic from data presentation and user interaction, by introducing a "controller" as an intermediate component.

ASP.NET MVC 2 includes support for a new feature called "areas" that Guthrie said enables developers to "more easily partition and group functionality across an MVC application."

Guthrie said:

"Areas provide a means of grouping controllers and views to allow building subsections of a large application in relative isolation [from] other sections. Each area can be implemented as a separate ASP.NET MVC project which can then be referenced by the main application. This helps manage the complexity when building a large application and facilitates multiple teams working ... on a single application together."

In addition, "ASP.NET MVC 2 now includes built-in support for the DataAnnotation validation support that first shipped with .NET 3.5 SP1-and which is used with ASP.NET Dynamic Data and .NET RIA Services," Guthrie said. "DataAnnotations provides an easy way to declaratively add validation rules to Model and ViewModel classes within an application, and have automatic binding and UI helper validation support within ASP.NET MVC."

Moreover, Guthrie said, "In a future ASP.NET MVC 2 preview we are planning to ship the jQuery Validation plug-in as part of the default project template, and add support for the automatic client-side JavaScript enforcement of DataAnnotation validation rules as well. This will enable developers to easily add validation rules in one place on either a Model or ViewModel object, and have them be enforced both client- and server-side everywhere it is used within the application."

Also, ASP.NET MVC V2 includes new HTML user interface helpers that enable developers to "use strong-typed lambda expressions when referencing the view template's model object," Guthrie said in the post. "This enables better compile-time checking of views (so that bugs can be found at build-time as opposed to run-time), and also enables better code IntelliSense support within view templates."