This article is a mirror article of machine translation, please click here to jump to the original article.

View: 19777|Reply: 0

[Source] A potentially dangerous Request.Form value was detected

[Copy link]
Posted on 12/18/2015 2:54:45 PM | | |

This problem is because there are HTML strings in the form you submit, for example, you enter html tags in the TextBox, or use the HtmlEditor component in the page, etc., the solution is to disable validateRequest.

If you are .NET 4.0 or higher, be sure to look at Method 3.

This method works in both asp.net webForms and MVC

Method 1:

Add this sentence to the header of the .aspx file:

Method 2:

Modify the web.config file:

Because validateRequest defaults to true. Just set it to false.


Method 3:

web.config

Because 4.0 validation is enabled before HTTP BeginRequest, the validation of the request applies to all ASP.NET resources, aspx pages, ashx pages, web services, and some HTTP handlers, etc.






Previous:Retrieving components with CLSID {000209FF-0000-0000-C000-00000000046} in a COM class factory lost...
Next:C# Forms Pass Values Between Forms, the first form continuously passes values to the second form
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com