Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Andrew Arnott 7 posts 58 karma points
    Feb 20, 2014 @ 14:18
    Andrew Arnott
    0

    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?

     

  • Stefan Kip 1614 posts 4131 karma points c-trib
    Feb 20, 2014 @ 15:32
Please Sign in or register to post replies

Write your reply to:

Draft