views:

31

answers:

1

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

A: 

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

Charlino
This is exactly what I was looking for. I had tried that before but was apparently using it incorrectly. Thank you very much!
castis