Answers for "get all errors in Model mvc"

1

get all errors in Model mvc

foreach (ModelState modelState in ViewData.ModelState.Values) {
    foreach (ModelError error in modelState.Errors) {
        DoSomethingWith(error);
    }
}
Posted by: Guest on July-10-2021

Browse Popular Code Answers by Language