What to do when a page edits or runs a commit, and there is a "potentially dangerous Request.Form value detected from the client" issue? As shown in the following illustration:
There are several solutions to this error in the following blog Master summary:
Problem reason: Because in asp.net, when a request submits a string of HTML code or JavaScript, the program system thinks it has potentially dangerous values. The environment configuration will report an error such as "detects potentially dangerous request.form values from the client".
1, the current submission page, add code
Opens the current. aspx page with the header code: validaterequest= "False", such as:
Copy Code code as follows:
<%@ Page language= "C #" validaterequest= "false" autoeventwireup= "false" codefile= "Default.aspx.cs"%>
2, the global modification Web.config configuration file (this does not recommend, unsafe)
Open the Web.config file, and in the middle of <system.web></system.web>, add the following code:
Copy Code code as follows:
<pages validaterequest= "false"/>
3, another way to deal with:The reason is that the transmitted value contains a special dangerous symbol, so you can encode the string using the Server.HTMLEncode (string) method before passing it, which will escape the dangerous word as a normal character. such as Textbox1.text=server.htmlencode (str);