By default ASP.net will do request validation to make sure values submitted by the user aren't potentially dangerous. See this popular queston regarding how to disable it.
I have disabled it successfully so that the controller doesn't throw an exception if potentially dangerous characters are detected. However, if I access the Request.Forms property, it attempts to do request validation again and will throw the exception. Specifically what I'm doing is this: request.Form.ToString()
.
The controller has been decorated with [ValidateInput(false)]
and the Model decorated with [AllowHtml()]
neither of which are being honored while accessing the Request.Forms
property. How can I do this without the exception being thrown?