This article mainly introduced the asp.net from the client to detect potentially dangerous Request.Form value 3 kinds of solutions, this is the asp.net development in a more common classic question, the need friend may refer to under
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:
The code is 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:
The code is as follows:
<pages validaterequest= "false"/>
3, another approach: The reason is that the value of the transfer contains special dangerous symbols, then you can use the Server.HTMLEncode (string) method to encode the string, so that the dangerous word escape as ordinary characters. such as Textbox1.text=server.htmlencode (str);