The potential dangerous request. form value [solution] is detected from the client, and the client request. form

Source: Internet
Author: User

The potential dangerous request. form value [solution] is detected from the client, and the client request. form

When the page is edited or submitted, the "request. form value detected from the client" problem occurs. What should I do? As shown in:

The following bloggers summarize several solutions to this problem:
Cause: In asp.net, when a Request is submitted with a string such as html code or javascript, the program system determines that the Request has a potentially dangerous value. An Error such as "Request. Form value detected from the client" is reported in the Environment configuration.
1. Add code on the current submission page
Open the current. aspx page and add the code validateRequest = "false" to the page header, for example:

<% @ Page Language = "C #" ValidateRequest = "false" AutoEventWireup = "false" CodeFile = "default. aspx.

2. Modify the web. config configuration file globally (this operation is not recommended or secure)
Open the web. config file and add the following code in the middle of <system. web> </system. web>:

<Pages validateRequest = "false"/>

 

3. Another solution: Because the passed value contains special dangerous symbols, you can use the Server. htmlEncode (string) method to encode the string. This will escape dangerous characters into common characters. For example, TextBox1.Text = Server. HtmlEncode (str );

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.