What is Data Annotation Validator Attribute in asp.net MVC?
What is Data Annotation Validator Attribute in asp.net MVC?
The information provided here is part of Export Import Training online After the exploration of information technology, the world is on our finger tips to get any piece of information. However when I went through different subjects on the web, I realized, like every thing in society, internet also carries the good and the bad. I was surprised to note that, I could not find any good quality free tutorial program to enter in a good business especially in
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.
exp. - [RegularExpression('[a-z]', ErrorMessage = 'Invalid input characters')]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.