I am working on a website that uses several Contour MVC forms.
When, e.g. HTML is submitted in one of the fields, the partial view containing the form is replaced with the error message A potentially dangerous Request.Form value was detected from the client (fd7ca767-c7cd-4755-91c6-724ec969e8f3=""), indicating a httprequestvalidationexception has been triggered.
This makes sense, and I have put some js in place to strip out potentially dangerous values before input.
However, for those few who are entering the potentially dangerous avlues without js enabled, I'd like to display something a little more human friendly and informative than the YSOD stub that is currently showing.
Does anyone have any suggestions on how to trap this, and replace it with a better message?
Catching httprequestvalidationexception
I am working on a website that uses several Contour MVC forms.
When, e.g. HTML is submitted in one of the fields, the partial view containing the form is replaced with the error message A potentially dangerous Request.Form value was detected from the client (fd7ca767-c7cd-4755-91c6-724ec969e8f3=""), indicating a httprequestvalidationexception has been triggered.
This makes sense, and I have put some js in place to strip out potentially dangerous values before input.
However, for those few who are entering the potentially dangerous avlues without js enabled, I'd like to display something a little more human friendly and informative than the YSOD stub that is currently showing.
Does anyone have any suggestions on how to trap this, and replace it with a better message?
This might be helpful: http://www.christiaanverwijs.nl/post/2012/06/27/NET-HttpModule-to-log-all-unhandled-exceptions-in-IIS-75-through-Log4NET-(globally-or-per-site).aspx
is working on a reply...