Validating system model
MVC determines type attribute values based on the .
NET data type of a property, possibly overridden using attribute does no real server-side validation.
MVC uses validation attributes in addition to type metadata from model properties to validate data and display any error messages using Java Script.
When you use MVC to render form elements from a model using Tag Helpers or HTML helpers it will add HTML 5 data- attributes in the form elements that need validation, as shown below.
Validation is necessary although it can be redundant and tedious to implement.
The Submit button runs Java Script that either submits the form or displays error messages.Many useful validation attributes can be found in the System. For those times, you can create custom validation attributes by deriving from .