ASP .NET MVC 3 Preview
ASP .NET MVC 3 Preview
Wednesday, 28 July 2010

A preview of version 3 of the ASP .NET MVC framework is available before programmers have had time to settle in with version 2. Microsoft seems to be serious about making MVC the way to do ASP.



Microsoft's MVC framework is currently one of its fastest pieces of development. Hot on the heels of version 2.0 (issued in March) we now have a preview of version 3.0 - download from: Microsoft Downloads.



The update claims to be compatible with version 2.0 so you can install the new framework and carry on working. It can be installed along side the earlier versions adding a new set of project templates to Visual Studio. It also works with Web Developer 2010 Express.

The biggest change is the inclusion of the Razor view engine. You can now select between a standard ASPX or a Razor based MVC 3 project:


Whether you think that Razor is a good idea or not is another matter. It produces denser code and mixes HTML and procedural code in a way that could easily become uncontrolled. On the other hand it is undeniably simpler and more direct.  At the moment the Razor syntax is not fully supported by IntelliSense but it will be in the next release, along with unit testing and a default page layout.

The other big new feature is the  Add View dialog box now allows you to select which template engine to use. A drop down list lets you pick from any that you have installed. This makes it easier to use and develop third-party template engines. 

If you are keen on using Ajax the new JSON binding support will also be welcome. You can build a JSON request in the usual way, using jQuery makes it easy, and then write an action method to handle the request that accepts a parameter with properties that correspond to the JSON fields posted. That is the Javascript object that the JSON would generate is automatically available as a .NET object. Support for the jQuery validation library and better support for "unobtrusive" Javascript - even though this is a vague concept.  

Support for the Dependency Injection (DI)way of doing things has also been augmented. You can now use DI in controllers, views and action filters. Future previews will support DI in model binders, value providers and model metadata providers. MVC 3 supports the Common Service Locator library. DI is not a pattern much used in web application development but it is a natural match for the MVC approach.

There are a host of other minor improvements: Controller global filters, new ActionResult types, new model validation attributes and permanent redirects.

Although you can still use the ViewData property to pass data to the view you can now also use the dynamic ViewModel and access data via properties rather than dictionary keys. This seems like a good use of the new dynamic language facilities.

For more information see:



Further reading

Microsoft WebMatrix and Razor

MVC - it's the routing stupid!

ASP.Net MVC in Action

The Joomla MVC classes

Dependency Injection


Eclipse IoT Contest

There's a fast approaching submission deadline for the Open IoT Challenge organised by the Eclipse Foundation's Internet of Things (IoT) Working Group. Luckily all you have to do by November 23rd [ ... ]

Internet of Things MOOC Starts Today

A free online course that looks at how the IoT works and the possibilities and threats it offers is just starting. It comes from King's College London and is on the Future Learn platform.

More News








Last Updated ( Thursday, 29 July 2010 )

RSS feed of news items only
I Programmer News
Copyright © 2015 All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.