Reputation: 8223
I am rather new to mvc2 and when following a writeup on data annotations and such, I came across a bit of code that let me manually add a line of text to the validation summary.
I've searched for the last 2 or 3 hours and I've come to the point where I think I'm just searching for the wrong thing. Its not custom validators I'm looking for, but something that I can call from the controller to add error messages.
Does anyone know what I'm talking about?
edit: clarified title a bit
Upvotes: 2
Views: 1755
Reputation: 15890
Are you looking for:
ModelState.AddModelError("*", "There was an error processing your request")
MSDN - ModelStateDictionary.AddModelError Method (String, String)
MSDN - Validating Model Data in an MVC Application
HTHs,
Charles
Upvotes: 3