The last type of server control is called a validator. Rather than having to write custom script or VB code to check whether data returned by other controls is within specifications, ASP.NET includes a new type of control that checks it for you. The five types of validator controls you can use are:
- RequiredFieldValidator
- CompareValidator
- RangeValidator
- RegularExpressionValidator
... and a sort of "roll your own" control:
- CustomValidator
There's also a new ValidationSummary control that you can use to display the error messages from all the validation controls in one place.
An example of the CompareValidator in action can be seen at the bottom.
These simple examples demonstrate that one of the best features of ASP.NET is that it handles most of the work of capturing, transmitting, and interpreting the event.


