What Are The Different Types Of Validators (Controls) In ASP.NET ?

Answer

The different types of validator controls in asp.net are…

  1. RequiredFieldValidator Control
  2. RangeValidator Control
  3. CompareValidator Control
  4. RegularExpressionValidator Control
  5. CustomValidator Control

Can you briefly tell me what each of these controls help you achieve?

Sure.

  • RequiredFieldValidator Control can be used to make sure that the user enters something into the field that it is associated with in the form.
  • RangeValidator Control compares what is entered into a form field with two values and makes sure that what was entered by the user lies in between these two specified values.
  • CompareValidator Control compares the value entered into the form field to another field, a database value, or any other value that you specify.
  • RegularExpressionValidator Control is a validation control that enables you to check the user’s input based on a pattern defined by a regular expression. This is commonly used to validate email addresses, zipcodes and other such data items.
  • CustomValidator Control enables you to develop your own custom server-side or client-side validations if all the above don’t work for you.

, {0}

Leave a Reply