C#webfrom six verification and use method

Source: Internet
Author: User

C # contains six types of authentication methods, namely:

One, non-null verification requiredfieldvalidator.

Second, comparative verification CompareValidator.

Third, scope verification RangeValidator.

Four, the regular expression validation RegularExpressionValidator.

V. Verification summary ValidationSummary.

Vi. custom Validation.

Two application tips:


1. Prevent the button from firing the validation control.
By default, the Class 3 button fires validation.
If you do not want to fire validation: give the button a causevalidation=false

2. Verify the problem with the grouping.
Set the ValidationGroup property of the input control (text box, radio, multiple selection), validation control (non-null, contrast, range, regular, custom, summary), button to the same value.

They become a group.

The first three attributes that need to be modified to use the validation space (six general authentication methods are common):

1.ErrorMessage: Error message displayed for validation failure

2.Display: How the Validator is displayed-in general dynamic display (verification failure display).

3.CotrolToValidate: The control ID to validate (for example: Verify the contents of the account in the TextBox, cotorltovalidate the textbox ID).

(not to be continued/...)

C#webfrom six verification and use method

Related Article

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.