What do I do when the page edits or runs the submission with a "potentially dangerous Request.Form value detected from the client" issue? As shown in the following:
There are several workarounds for this error in the following blog Master summary:
Cause of the problem: because in ASP. NET, when a request commits a string such as HTML code or JavaScript, the program system considers it a potentially dangerous value. The environment configuration will report an error such as "potentially dangerous Request.Form value detected from the client".
1, the current submission page, add code
Open the current. aspx page, with the header plus code: validaterequest= "False", such as:
<%@ page language= "C #" validaterequest= "false" autoeventwireup= "false" codefile= "Default.aspx.cs" inherits= " Default "%>
2. Modify the Web. config configuration file globally (this is not recommended, unsafe)
Open the Web. config file, and in the middle of <system.web></system.web>, add the following code:
<pages validaterequest= "false"/>
If neither of these methods can be resolved, then look down,
Problem reason: Because your current. NET Ifreamwork Framework environment is 4.0
3. Similarly, open the Web. config configuration file, in the middle of <system.web></system.web>, plus the code:
4, if your website program itself is NET 2.0 environment development, but put in the VS2010 software run, also will appear this situation, you can switch the operation solution to net2.0 can, replacement method see page 3rd step: Click to enter
5, another method of treatment: The reason is that the value of the message contains a special danger symbol, then you can use the Server.HTMLEncode (string) method before transmitting, the string is encoded, so that the dangerous word escapes to ordinary characters. such as Textbox1.text=server.htmlencode (str);
Learn more, refer to Microsoft Web page: http://www.asp.net/whitepapers/request-validation
Later found that the original 3 years ago, the solution to this problem has a brief summary, but not so comprehensive, it seems that experience can let people grow is right, there is a summary of this issue article: VS2005 Debugging Problem Solution Collection
Potentially dangerous Request.Form value detected from the client [workaround]