Validation is an essential part of any web application. It is used to validate user input data. Before sending the user's input to different layers it must be validated.
Validation is of two types:-
1. CLIENT SIDE- client side validation is considered good for users as it gets feedback promptly and also untill the client validation is completed the page does not postback to the server
2. SERVER SIDE- server side validation is considered better for developers because it does not depend on the browser and will not fail.
Validation controls in ASP.NET
RequiredFieldValidation Control
CompareValidator Control
RangeValidator Control
RegularExpressionValidator Control
CustomValidator Control
ValidationSummary
Description of validators is defined in below table:-
Validation control
Description
RequiredFieldValidation
checks that validated control contains a value or not because it is not empty.
CompareValidator
It checks that the value of one control is matched to the value of another control or to a particular value.
RangeValidator
It checks that the value in the validated control is in between the particular number or text.
RegularExpressionValidator
It checks that the value in the validated control is matching with the specific pattern or expression.
CustomValidator
It allows to write a custom validation for the value of validated control.
0 Comment(s)