Solve Asp.net's "Slave client (......) The request. form value is potentially dangerous ." Error

Source: Internet
Author: User
The request. form value is detected in the client (free1 = "<p> & lt; % @ page valid.

Note:The request verification process detects potentially dangerous client input values, and the processing of the request has been aborted. This value may indicate that the application is compromised.ProgramSecurity attempts, such as cross-site scripting attacks. You can disable request verification by setting validaterequest = false in the page instruction or configuration section. However, in this case, it is strongly recommended that the application explicitly check all input.

Exception details:System. Web. httprequestvalidationexception: a potentially dangerous request. form value is detected from the client (free1 = "<p> & lt; % @ page valid.

Error analysis: the cause of the system error is in ASP. in NET 1.1, after the validaterequest attribute on the @ page command is opened, check to make sure that the user does not send potentially risky HTML tags in the query string, Cookie, or form field. If this situation is detected, an exception is thrown and the request is aborted. This attribute is enabled by default. You do not need to perform any operation to protect it. If you want to allow HTML markup to pass, you must manually disable this attribute.

 

Solution:

Solution 1:

Add validaterequest = "false" to the page entry in the. aspx file as follows:

<% @ Page validaterequest = "false" Language = "C #" autoeventwireup = "true" codefile = "test2.aspx. cs" inherits = "Test2" %>

Solution 2:

Modify the Web. config configuration file

<System. Web> <br/> <pages validaterequest = "false"> <br/> </pages> <br/> </system. Web>

Summary:

Solution 1 is recommended, because solution 1 only modifies the page test. aspx. If solution 2 is used, the entire solution becomesValidaterequest = "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.