ASP. NET-how to disable ASP. NET Server Control Verification

Source: Internet
Author: User

Under certain conditions, you may need to avoid verification. For example, you may have a page that can be sent even if the user does not correctly fill in all verification fields. You can setASP. NETServer Control, instead of client verification.

Security description: By default, ASP. NET The webpage performs request verification to ensure that the user input content does not contain scripts or Html Element. You can explicitly disable this function.

You can also disable the verification control so that it is not displayed on the page at all and does not use the verification control.

If you want to perform verification on the server without performing client verification, you can set the independent verification control to not generate client scripts. If dynamic updates on the client lead to page layout problems, or if you want to execute some servers before verificationCodeThis measure is particularly useful.

 

1. Disable verification in a specific control

causesvalidation set attribute to false .

The following example shows how to create the cancel button to avoid verification checks:

<Asp: button id = "button1" runat = "server"

TEXT = "cancel" causesvalidation = "false">

</ASP: button>

 

Ii. Disable verification controls

VerifyEnabledSet propertyFalse.

 

3. disable Client verification

verify the enableclientscript set the property to false .

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.