MVC.NET 2 Breaking Changes

Breaking changes in MVC.NET 2 (aka ASP.NET MVC 2):

  • There is a change to the behaviour of the Model Binder.  In MVC.NET 1, when a string property had no value to be bound to it, the Model Binder would assign an empty string to the property.  In MVC.NET 2 the model binder will assign null instead.  This can cause many issues.  See for more info.  I’d recommend getting used to the new MVC.NET 2 behaviour instead of using ModelBinders.Binders.DefaultBinder to go back to the MVC.NET 1 behaviour.
  • By default you can no longer return JSON from an Action that accepts HTTP GETs.  This is with good reason and closes up some serious potential security holes.  If you understand the implications, you can bypass this restriction on a case-by-case basis using the new overload of the Json method:

Leave a Reply

Your email address will not be published. Required fields are marked *