Microsoft posts preview of ASP.Net MVC 3
Microsoft MCTS Training is readying an update to its ASP.Net MVC (Model View Controller) technology for Web application development, leveraging the company’s new “Razor” view engine and offering enhancements for JavaScript.
The company posted on Tuesday Preview 1 of ASP.Net MVC 3, which provides an MVC programming model for building ASP.Net Web applications. ASP.Net 3 is the next major release of the framework. The preview is available at Microsoft’s website.
Lowering Total Cost of Ownership With Hybrid Web Security: Download now
[ See InfoWorld’s report on the release of MIcrosoft’s ASP.Net MVC 2 in March. ]
With MVC, the model contains core information for an application, such as data and validation rules, while the view encapsulates application presentation. The controller contains control-flow logic, interacting with the model and views to control information flow and execution of an application.
Preview 1 features two pre-enabled view engines: Razor and ASPX, said Scott Guthrie, corporate vice president of the Microsoft Developer Division, in a blog post. View engines are pluggable modules that implement template syntax options. Razor is optimized around HTML generation using a code-focused templating approach. Razor is intended to be compact, expressive, and fluid as well as easy to learn. It works with any text editor.
“‘Razor’ helps make view templates clean and concise and I think you’ll find it enables a very fluid coding workflow,” Guthrie said.
Razor file colorization and code intellisense is not yet supported in the Visual Studio IDE with the ASP.Net MVC 3 preview release, but plans call for adding these capabilities with a future preview. Another improvement planned for a future preview refresh is the ability to unit-test individual Razor template files without having to run the application or launch a Web server, Guthrie said.
Built-in JSON ( JavaScript Object Notation) binding support in ASP.Net MVC 3 enables action methods to receive JSON-encoded data and model-bind it to action method parameters, said Guthrie. Also, developers can connect client templates with action methods on the server that return and receive JSON data.
Future previews will include better support for unobtrusive JavaScript and direct backing for the jQuery validation library from within built-in validation helper methods.
The preview also includes controller-specific enhancements such as global filters, for declaratively applying “cross-cutting” logic.
An Add->View dialog in the preview makes it easy to choose a syntax when building new template files, Guthrie said. “It allows you to select any of of the available view engines you have installed on your machine — giving you the ability to use whichever view templating approach feels most natural to you,” he said.
Model validation improvements in ASP.Net MVC 3 include support for .Net 4 DataAnnotations metadata attributes. Version 3 also offers better support for applying dependency injection Microsoft MCITP Certification.
ASP.Net MVC 3 is compatible with ASP.Net MVC 2, making it easy to update MVC 2 projects to MVC 3, Guthrie said.