|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Friday, March 24, 2006Validation Controls(Chapter3)A validation control enables us to validate an input and display an error message if necessary. It is very much like other server-side controls with certain additional methods and properties. First, the server treats it as an invisible control. After the user has entered erroneous data, it becomes visible. It is a powerful, rapid application development feature; however, a developer needs to understand its behavior and the methods thoroughly before he or she can appreciate it.There are certain rough edges in the Beta 2 version, which hopefully will be polished in the final product.The best strategy to learn the family of controls is to learn them one at a time, and finally to apply the summary validation. Various types of validation controls are as follows:
By default, each of the validation controls performs the validation task at the client-side as well as at the server-side. Except for the RequiredFieldValidator, all other validation controls treat an empty field as a valid field.Therefore, we will need to apply a RequiredFieldValidator to every input field that we want to validate. You can attach more than one validation control to an input. For example, we may use a RequiredFieldValidator and a RangeValidator to ensure that an input is not empty and falls within a specified range. There are a number of common properties in these controls. The major ones are:
|
0 Comments:
Post a Comment
<< Home