User Input Validation in ASP.NET

Before submitting a web page to server, Input validation on web page is one of the important task. Presently, six different validation server controls are available for ASP.NET:

  1. RequiredFieldValidator
  2. CompareValidator
  3. RangeValidator
  4. RegularExpressionValidator
  5. CustomValidator
  6. ValidationSummary
1: RequiredFieldValidator : Makes an input control a required field 2: CompareValidator : Allows for comparisons between the user's input and another item using a comparison operator. 3: RangeValidator : Checks that the user enters a value that falls between two values 4: RegularExpressionValidator : Checks that the user's entry matches a pattern defined by a regular expression. 5: CustomValidator : Allows you to write a method to handle the validation of the value entered 6: ValidationSummary : Displays a report of all validation errors occurred in a Web page

You can also customize validation for your own needs. Then, if there are any errors in the form data, these validation server controls enable you to customize the display of error information on the browser. The powerful thing about using these validation controls is that they are easy to implement. Modifying them is a piece of cake, so you can easily check for all sorts of parameters on the input generated from your forms.