10.6.10

Validation Controls

* Validation Controls
- CompareValidator
We need to compare user input to another value (e.g., another property or constant) in a style similar to the old and ever lasting if statement.
- CustomValidator
Your validation needs does not fit on any of the categories specified in this table but you are still able to write code that checks for the validity of this input.
Here you can use the ValidateEmptyText property to do validation even if the validation value is empty. This is a new feature in ASP.NET 2.0
- RangeValidator
You need to be sure whether the input falls between two bound (Example: User age must be between 18 and 99)
- RegularExpressionValidator
You need the input to follow a consistent pattern (Example: a phone number that must start with '+' and must be composed of 9 to 10 digits)
- RequiredFieldValidator
You need to force the user to input a value inside a particular control and not to leave it empty. (Example: The User Name field in a login form)

No comments: