WebService detection of potentially dangerous request.form values

Source: Internet
Author: User

Method One: Add this sentence in the header of the. aspx file: <%@ page validaterequest= "false" enableeventvalidation= "false"%> method two: Modify the Web. config file: < configuration> <system.web> <pages validaterequest= "false"/> </system.web> </configuratio n> because the validaterequest default value is true. Just set it to false.

Both of these methods are only effective for asp.net2.0, and for asp.net4.0 above the set estimate does not completely solve the problem, if you need to really solve the problem must follow such steps: 1. The Requestvalidationmode in the HttpRuntime configuration section   The attribute is set to Requestvalidationmode= "2.0". Example:

In ASP. NET 4.0, The request verification feature is advanced to ihttphandler.beginrequest this method is requested, which means that all HTTP requests that enter the ASP. NET request channel will be validated for the validity of the requested content, including some custom Httphandler,webservic e requests, and even custom request handlers with custom HTTP module. The result of request validation processing is that we set validaterequest=false in the page, or controller, and it will fail to prevent the program from validating the requested input. Because this is done, the validator cannot get the requested page if the validation request is disabled because HttpHandler has not yet been instantiated. And in asp.net4.0, there's no place for me to disable this authentication feature. However, for compatibility reasons, ASP. NET allows us to configure the request validation behavior by using ASP.

WebService detection of potentially dangerous request.form values

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.