Hi
I want to get all the error messages out of the modelState without knowing the key values. Like I just want to do a for loop and and grab all the error messages that the ModelState has.
How can I do this?
Thanks
Hi
I want to get all the error messages out of the modelState without knowing the key values. Like I just want to do a for loop and and grab all the error messages that the ModelState has.
How can I do this?
Thanks
foreach (ModelState modelState in ViewData.ModelState.Values) {
foreach (ModelError error in modelState.Errors) {
DoSomethingWith(error);
}
}