C #. NET technology insider (06) -- Verification

Source: Internet
Author: User

 

1.Client check:

First, configure the client check. Javascript Script library, Webuivalidation. js . Install script Library: Aspnet_regiis-C, Uninstall script Library : Aspnet_regiis-e .

Disable client check:<% @ Page clienttarget = "downlevel">

2.Verification required---- Requriedfielevalidator:

Isvalid: Whether the test is passed, yes -True, No -False; You can check controls or pages. Only all verification controls Isvalid Is True, page. isvalid Only True.

Initialvalue: Control initial value. Compare with the initial value: for example, the start text box displays" Enter data To check whether other values are input, you can use Initialvalue = " Enter data ", And then use Isvalid Judgment.

3.Regular Expression Verification:Regularexpressionvalidator

Text:Error message;

Errormessage: validationsummaryError message displayed. IfTextIf it is null, the property value is displayed.

Verification Email:\ S + @ \ s + \. \ s {2, 3}

Verification password and User name: letters, numbers, underscores (_), limited length:\ W {8, 20}

URL:Http // + \ s + \. \ s +

0-10Non-space characters:\ S {0, 10}

4.Comparison value:Comparevalidator

You can compare two controls or controls with fixed values.

Identifiable type: SetOperatorSetDatatypecheck, And thenTypeSet to date and other types.

5.Custom checkCustomervalidator

OnservervalidateAdd custom validation events, where event parametersEIncludingIsvalidAndValueTwo parameters.

6.Disable inspection:

If you click"Cancel"Button, you canCausevalidationSet propertyFalse.

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.