A potentially dangerous request. form value is detected from the client (hd_content = "test Ang, HA 333.

Source: Internet
Author: User

You can avoid adding validaterequest = "false" to. aspx.

For Web ApplicationsProgramTo prevent hacker attacks that rely on malicious input strings, it is essential to restrict and verify user input. Cross-site Scripting is an example of such attacks. Other types of malicious data or unwanted data can be input in various forms in the request. By limiting the data types that are allowed in applications at a lower level, you can block unwanted events, even when you useCodeThis is also true when programmers do not properly use the appropriate verification technology.

when request verification detects potential malicious client input, this exception is thrown to abort request processing. Request suspension can indicate attempts that endanger your application security, such as cross-site scripting attacks. It is strongly recommended that your application explicitly check all input related to request abort. However, you can also run the @ page command validaterequest set the property to false to disable request verification, example:

<% @ page validaterequest =" false "%>

To disable application request verification, you must modify the Web. config file of the application or create a web. config file. Pages Section Validaterequest Set property False, As shown in the following example:

 
<Configuration>
<System. Web>
<Pages validaterequest = "false"/>
</System. Web>
</Configuration>

To disable request verification for all applications on the server, you can modify the machine. config file.

Another step is to add processing to the onerror event on the page:

Protected   Void Page_error ( Object Sender, eventargs E)
{
Exception ex = Server. getlasterror ();
If (EX Is Httprequestvalidationexception)
{< br> response. redirect ( " default. aspx " );
server. clearerror ();
}
}

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.