Copied to clipboard

Flag this post as spam?

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


  • Kris Janssen 210 posts 569 karma points c-trib
    Feb 04, 2015 @ 19:39
    Kris Janssen
    0

    Contour exception handler on form submit

    This question is related to another one.

    I have a markdown enabled text area on my form that now handles tags such as

    H<sub>2</sub>
    

    pretty wel...

    enter image description here

    However, the request will be refused because of these special characters in it and I will get an exception:

    rror loading MacroEngine script (file: MvcRenderContourForm.cshtml, Type: ''. Exception: System.Web.HttpRequestValidationException (0x80004005): A potentially dangerous Request.Form value was detected from the client (6a21853a-46c2-4bde-84b5-ea032302851b="...ition in C<sub>2</sub> by pert...").
    

    That is what my original question was about, i.e. disabling request validation.

    However, the issue is more broad:

    How can I gracefully handle this type of exception in Contour??

    Now I will just get:

    Error loading MacroEngine script (file: MvcRenderContourForm.cshtml)
    

    Any thoughts??

    Update 1

    This post is probably related... It deals with handling uncaught exceptions in Razor scripts...

Please Sign in or register to post replies

Write your reply to:

Draft