I\'ve been playing with the new MVC3 Json Model Binding and it\'s quite nice.
Currently, I can post JSON to controller and bind it. Model Validation occurs nicely too.>
@Junto and @Jamey777, you both pass the ModelState to your error function but then you use the global variable instead of the parameter.
and why dont you just use a little linq like
private Dictionary GetModelStateErrorsAsString()
{
return ModelState.Where(x=> x.Value.Errors.Any())
.ToDictionary(x => x.Key, x => x.Value.Errors.First().ErrorMessage);
}