Validator Control Learn the first day

Source: Internet
Author: User
Tags regular expression
Today began to seriously learn validator control, draw the following experience:
1. With regard to the use of the RegularExpressionValidator control, I used this feature first because I wanted to use this control for email verification. I started by typing: [a-za-z0-9]@ [A-za-z0-9]{1,}, but the validation always fails, prompting for errors until I enter the format of x@x (or any of the characters in the x@*--* that represent me). Understand, the original in each [] after the length of the judgement, modified as follows [a-za-z0-9]{1,}@ [A-za-z0-9]{1,}, successfully passed the verification. Later looked up the data and found the use. {1,}@. {1,} more convenient (. On behalf of any character)
2. About the use of the ErrorMessage property. The error he prompts does not appear directly on the page, but rather passes the value of the property to ValidationSummary. The output of the page is then performed by ValidationSummary.
About the kinds of validator controls (there are 5 of them for validation, and one that provides a collection of validation results):
1. requiredfieldvalidator--is used to check whether content is entered in the validation control, and if not, an error message is generated.
2. comparevalidator--is used to enter information to compare with existing information, and if the result is false, an error is generated.
3. rangevalidator--is used to check the range of input information.
4. regularexpressionvalidator--is used to check whether the input conforms to a regular expression.
5. customvalidator--is used for developer custom validation controls.
6. validationsummary--is used to collect and display page validation results.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.