Asp.net MVC 2.0 around the corner
When you’re reading this article, the fact that Asp.net mvc 2.0 will be released soon won’t come as a surprise. Both Phil Haack and Scott Guthrie amongst others have been blogging about it. I started a new web project recently and was doing the input validation using Xval by Steve Sanderson. I made a leap of faith and upgraded the project to MVC 2.0 because xval had some quirks (or actually the jquery validation plugin did). Luckily those were fixed by MVC’s new build in validation system. The Gu has an excellent post on the subject. I am using the microsoft validation scripts for the client side, and they work very well, even taking culture settings into consideration out of the box.
There is a lot more to MVC 2.0, the templates are nicer. The Html.TextBoxFor(p => p.Id) is very handy, and make the input forms a lot easier to write. The ModelBinding seem to be much better now as well. With 1.0 I sometimes had to some of it by hand, as the binder didn’t grasp what it was supposed to bind. I haven’t run into that in 2.0.
The attributes for Actions / methods in your controller have been streamlined as well. You only need to put [HttpPost] over actions for Form Posts for example. One thing I haven’t used yet but might come in handy on a big project some day might be the Areas. OdeToCode has a nice article on this new feature.
Over at TekPub, Steve Sanderson and Rob Conery are doing an excellent series on MVC and are also going into the new things of 2.0. If you can spare $28,- I highly recommend watching it.