I have seen this error before, but I can not get around it. In this case, I have an ASHX page spitting out a simple HTML form with a text box into which XML can be sent. When I try to read the form, I get a "potentially dangerous Request.Form value ...".
Since this is a common handler, the "ValidateRequest" attribute is not available. However, I already had this defined in web.config:
<location path="xml/MyGenericHandler.ashx">
<system.web>
<pages validateRequest="false" />
</system.web>
</location>
This snippet precedes the switch from .NET 3.5 to 4.0, so I guess where the error occurred.
Any idea how to get around this error for ASHX pages?
source
share