ASP.NET MVC2 and JSON model binding with validation to an action method ASP.NET MVC2 and JSON model binding with validation to an action method json json

ASP.NET MVC2 and JSON model binding with validation to an action method


For MVC2 you need Futures. Get the dll, add reference to it and in Global.asax add (Application_Start):

ValueProviderFactories.Factories.Add(new JsonValueProviderFactory());

Don't know about MVC3 - I'm waiting for an RTM.But I do encourage you to give it a go, as sending JSON up to Actions is a pure bliss ;-)


In MVC 3 there is ValueProviderFactories provided out of the box.