Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET Webforms - "A potentially dangerous Request.Form value was detected from the client"

I'm getting the following error when I submit html in a textarea "A potentially dangerous Request.Form value was detected from the client." How do I disable this type of security validation to just one field and not the entire page/website. What I do NOT want to do is set validateRequest to false for an entire page/website.

EDIT: I need a solution for .NET Framework 3.5

like image 781
burnt1ce Avatar asked Oct 02 '22 19:10

burnt1ce


1 Answers

In .NET 4.5 you can use the ValidateRequestMode property to exclude fields from Request Validation.

However in .NET 4 and Lower this cannot be done, and you must either validate the entire request or not.

like image 66
Nunners Avatar answered Oct 05 '22 09:10

Nunners