Thursday, February 9, 2012

Validation Control in ASP.NET

Validation Control in ASP.NET are the following : 
  • Required Field Validator
  • Range Validator
  • Regular Expression Validator
  • Compare Validator
Required Field Validator
 This Validator check whether the assigned textbox has a value or null. 

Range Validator
Set the DataType ,  Maximum and Minimum value of the allows for the TextBox
E.g      type="Date" minimumvalue="01-01-2006" maximumvalue="31-12-2006"

Regular Expression Validator
a customize regular expression can be set base on the user's need .
see this link for some of theregular expression : http://www.regular-expressions.info/reference.html

Compare  Validator 
control allows you to compare the value entered by the user into an input control, such as a TextBox control, with the value entered into another input control, or with a constant value. You can also use the CompareValidator control to determine whether the value entered into an input control can be converted to the data type specified by the Type property.