So, I just installed the new ASP.NET MVC release (see Scott Gu's blog) and updated my project which was based on beta 1. In the release notes there were some information about how to upgrade, although I somehow managed to screw it up so I got "HtmlHelper does not contain RenderPartial" error messages. The issue I had was that I messed up the namespaces in the web.config. To see how it should be just create a new ASP.NET MVC project and compare the web.config with your current web.config.

There has been a change to the ModelBinder API which produced compilation errors, the ModelBinderResult class seems to have been removed and the BindModel() method now takes two arguments of type: ControllerContext and ModelBindingContext. The ControllerContext contains among other things the HttpContext. The BindModel() method doesn't remove the ModelBinderResult anymore, instead it returns object. That change seems a bit weird, but I'm sure it was done with a lot of consideration.

There was another breaking change for me which had to do with the ModelStateDictionary. The method SetAttemptedValue(string key, string value) is removed? I'm not sure if it's been replaced by the method SetModelValue(string key, ValueProviderResult result), I can't find any information about it in the release notes.

What I did find in the release notes however was the improved support for file upload, just in time for me to begin implementation of a an upload document and image feature for the web application I'm currently building.


blog comments powered by Disqus