I have a question about ModelState
and validation error messages in MVC3.
I have in my register view the @Html.ValidationSummary(false)
that shows me the DataAnnotations
error messages from my Model object. Then.. in my Register action controller i have the ModelState.IsValid
, but inside that if(ModelState.IsValid)
i have another error controls that add to the modelstate with ModelState.AddModelError(string.Empty, "error...")
and then I do a RedirectToAction
, but the messages added in the ModelState
doesn't show at all.
Why this is happening?