What is Data Annotation Validator Attribute in asp.net MVC?
What is Data Annotation Validator Attribute in asp.net MVC?
33510-Mar-2022
Updated on 10-Mar-2022
Home / DeveloperSection / Forums / What is Data Annotation Validator Attribute in asp.net MVC?
What is Data Annotation Validator Attribute in asp.net MVC?
Steilla Mitchel
10-Mar-2022Data Annotation in MVC:
There are mazor role of Data Annotation in asp.net mvc. It is used to validate the properties when designing the model page. This validation is used in both side, client side as well as server side. There are some Data Annotation used in mvc is given below,
Required :
It is used to specify a property as required.
RegularExpression
It is used to specifies the regular expression to validate the value of the property.
Range :
It specifies the Range of values which provide this property
StringLength :
Specifies the Min length & Max length for a given string property.
MaxLength :
Specifies the Max length for the entered property value.
MinLength :
It is used to check for minimum length of property value.