C programming validating user input
Custom Validators can be used to make your own custom validation expressions.
You can find many free regular expressions on the website Here is a small example of the Custom Validator Control.
If both the Control To Compare and Value To Compare properties are set for a Compare Validator control, the Control To Compare property takes precedence.
A good use of the compare validator is to check whether the passwords entered by the user in the two Text Boxes while registering for a website are same or not.
Some of the built in expressions are Email, postal code, US telephone number and many more.
If the user input does not match the regular expression expected an error will occur and the request for the resources will not be authorized unless the user corrects the input data. The Range Validator control is used to check whether the input control contains value in the specified range.
The range can be used when you need to restrict the user data.
Suppose you want the user to enter the number in the Text Box which is between 20 and 25 you can use range validator mimimum and maximum properties to restrict the user input.
The compare validator can be used to compare against a value or another control.On the other hand, because the Web Server is performing all the validation, you can trust the validated data.