23/08/2013
Today I am discussing about validation.
Validation: Validation means restrict a user to enter any wrong data in your application. This is very important part in Software development. If you don’t use this, you application cannot give you the exact result.
In ASP. Net, there are different types of validation.
1. RequiredFieldValidator : This validator restrict or force user to enter value on the field, if it is Textbox or Dropdown.
How to Use This control on ASP.NET:
For textbox:
Select
Select
Pakistan
2. RegularExpressionValidator: This validator force user enter correct data, but it optional. It means you cannot enter any data on the field, it is not giving any error, but if put any data, information must be correct.
Like:
a. Email: must be like [email protected]
b. url: must be like http://www.abc.com
c. Phone: only digit
d. Name: must be Aphabets
e. Password: must be alphanumeric with special character.
3. CompareValidator: This validation is used for compare any data or info enter by user.
Like:
a. Date: must be of date type.
b. Retype Password: must be same as Password.
4. RangeValidator: This check value within the range, like must be beween 0-10