<% ViewData.ModelState.IsValid %>
or
<% ViewData.ModelState.Values.Any(x => x.Errors.Count >= 1) %>
and for a specific property…
<% ViewData.ModelState["Property"].Errors %> // Note this returns a collection
More Related Contents:
- An invalid form control with name=” is not focusable
- Using sections in Editor/Display templates
- Manually Triggering Form Validation using jQuery
- How can I change or remove HTML5 form validation default error messages?
- What’s the valid way to include an image with no src?
- Adding html class tag under in Html.DropDownList
- HTML button calling an MVC Controller and Action method
- Html attributes for EditorFor() in ASP.NET MVC
- Mailto on submit button
- HTML5 validation when the input type is not “submit”
- How do I maintain scroll position in MVC?
- Delay HTML5 :invalid pseudo-class until the first event
- Are nested HTML comments possible?
- HTML5 phone number validation with pattern
- HTML5 Required input styling
- Conditional HTML Attributes using Razor
- What elements can be contained within a tag?
- Is there a minlength validation attribute in HTML?
- How do I make a field required in HTML?
- How do I style the HTML form validation error messages with CSS?
- How can I change or remove HTML form validation default error messages?
- Is div inside list allowed? [duplicate]
- Bad value X-UA-Compatible for attribute http-equiv on element meta
- Html.BeginForm() with an absolute URL?
- Is the copyright meta tag valid in HTML5?
- What’s the point of valid CSS/HTML?
- How to get the text from the HTML5 input field error message in Selenium?
- Is it possible to validate the size and type of input=file in html5
- Auto height on parent container with Absolute/Fixed Children
- How to display alt text for an image in chrome