
Using Validation Controls
Now that you have an understanding of what validation controls can do, let’s
have a look at the different controls that are available in ASP.NET:
❑
RequiredFieldValidator
❑
RangeValidator
❑
RegularExpressionValidator
❑
CompareValidator
❑
CustomValidator
❑
ValidationSummary
If you’re 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 control—there’s no
229
Using Validation Controls
Get Build Your Own ASP.NET 2.0 Web Site Using C# & VB, Second Edition now with O’Reilly online learning.
O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.