ASP.NET MVC model state as text
- by David Moorhouse
Is there an easy way to get a summary string of the errors that have been added to a controller's modelstate?
I'm looking to return this in an Ajax method and want the validation errors etc to be returned to the client (i.e. the view does not exist for this method call).
Or do I have to loop through the modelstate and look at each object and extract the error text manually?