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