ASP.NET MVC model state as text

Posted by David Moorhouse on Stack Overflow See other posts from Stack Overflow or by David Moorhouse
Published on 2010-06-01T00:00:07Z Indexed on 2010/06/01 0:03 UTC
Read the original article Hit count: 159

Filed under:
|
|

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?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about mvc