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 );