List of Validation Controls in ASP.NET

Validation Controls is very interesting topic, the reason is by using these controls you can restrict users from entering invalid content.

ASP.NET validation controls provide two ways of validation: Server-side or Client-side. Click To Tweet

So as per our requirement we can choose either or both of them.

There are six validation controls available in ASP.NET Toolkit by default. If you want to use some other fancy validation controls, then you can download AJAX toolkit from CodePlex website.

List of Validation Controls ASP.NET

List of Validation Controls in ASP.NET

List of Validation Controls in ASP.NET

  • Required Field Validator
  • Compare Validator
  • Range Validator
  • Regular Expression Validator
  • Custom Validator
  • Validation Summary

Advantages of having validation controls:

  • You can validate the data before hitting to your program or database.
  • You can discard malicious or invalid data and refrain it from entering.
  • Gives you the option of custom validation to control other validations.
  • There are multiple ways of reporting errors to the users.
  • Just few configuration changes and no need to worry about the whole validation logic.

 

Details with Syntax:

Required Field Validator : Checks whether control contains data.

Compare Validator : Comparison between two controls data.

Range ValidatorChecks if the data to be validated falls between the specified range.

Regular Expression Validator : Email Format,Phone Format etc.

Custom Validator : Checks the validity of a entered items through a client side script or server side code.

Validation Summary : It doesn’t performs any validations. However, Displays a summary of validation errors.

Hope you found this post useful and worth. keep watching this space & stay connected for more stuffs on ASP.NET.

What do you think?

Dear Reader,
If you have any questions or suggestions please feel free to email us or put your thoughts as comments below. We would love to hear from you. If you found this post or article useful then please share along with your friends and help them to learn.

Happy Learning!