1. Home
  2. Computing & Technology
  3. Visual Basic

ASP.NET - Learn Programming for the Networked World - Part 2

By , About.com Guide

5 of 7

The Validator Controls

Validator Control Code

Validator Control Code

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.

Explore Visual Basic
By Category
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Visual Basic
  4. Learn VB.NET
  5. Learn ASP.NET
  6. ASP.NET - Learn Programming for the Networked World - Part 2

©2009 About.com, a part of The New York Times Company.

All rights reserved.