Validation Controls in visual studio

In this resource i define the working of all six Validation Control of website application with an example. Example has a form of login type. All the validation controls are used upon the text box. validation controls are used on login form because many user not enter there name, or enter unmatched passwore etc.

A Validation control is used to validate the data on a web page within a input control. If the data does not pass the validation defined in the validation control, it will display an error message in the valiadtion summary or in front of input control, wherever you decided.
with this Resource i am also uploading a project which has all six validation controls. validation controls are the controls for validate a text field like text is not empty, text in text box should in range.
six validation controls are:

- used if you not want a text field empty.
It forces the user to input a value in the field. User can not post the page to server with empty value.
- for setting range for the text box.
It forces the user to input value in a range defined in the input control. you can not enter a value greater or lower then range.
- that email enter in text is valid or not(etc.).
It enforces a pattern to the input control. you must have to write text in the pattern specified.
- for comparing value of two text.
It compare values of two input control like password. if values in password and repeat password is mismatch, then you are not able to save.
- this used for security code checker.
It allows you to write a method for comparison. you write your custom method according to your need.
- this is used for giving a summary of all the errors by validation control you used.
It displays all the validation occurs in the page in a single place.

I also give a text file in my upload which shows how we use these six controls. There is a general problem in validation control that if you have two buttons in a page with validation control than both buttons actives the validation control. to over come from this problem you use a property named ValidationGroup, by right clicking on any button or validation control go to properties and you see that property.
then simply named the groups anything you want. this group activate only when its member activate it.
hope it helps.




  • Validation Controls (
  • Comments

    No responses found. Be the first to comment...

  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name: