Using Validation Controls
Now that you have an understanding of what validation controls can do, lets
have a look at the different controls that are available in ASP.NET:
RequiredFieldValidator
RangeValidator
RegularExpressionValidator
CompareValidator
CustomValidator
ValidationSummary
If youre working with Visual Web Developer, you can see the validation controls
in the Validation tab of the Toolbox, as Figure 6.4 illustrates.
Figure 6.4. Accessing the validation controls in Visual Web
Developer
Validation controls are a particular kind of web server control, and are inserted
as tags with the asp: prefix. Once a validation control is inserted, it validates an
existing control elsewhere on the page, and presents an error message to the user
if necessary. To validate a field, all you have to do is insert a controltheres no
229
Using Validation Controls

Get Build Your Own ASP.NET 2.0 Web Site Using C# & VB, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.