SyntaxFix
Write A Post
Hire A Developer
Questions
bool hasErrors = ViewData.ModelState.Values.Any(x => x.Errors.Count > 1);
or iterate with
foreach (ModelState state in ViewData.ModelState.Values.Where(x => x.Errors.Count > 0)) { }