Copied to clipboard

Flag this post as spam?

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


  • Arthur 6 posts 26 karma points
    Jan 03, 2014 @ 11:45
    Arthur
    0

    ASP.NET Request validation

    I’m sorry if I’m posting this question in the wrong topic or I’m repeating someone’s question.

    I have a problem with my Umbraco (v4.7.2).

    Currently I can’t publish content from Umbraco interface because of ASP.NET request validation. When its turn off everything is working like a charm.

    I was looking for some kind of solution for this because I worry about disabling request validation for my application. So I decided to turn off the validation programmatically for some time while it’s needed.

    My first solution was to subscribe to umbraco.cms.businesslogic.web.Document events. For example I can disable validation on Document.BeforePublish event and then turn on validation on Document.AfterPublish event. But this didn’t work because request validation provides validation before Document.BeforePublish event took place.

    The second solution was to implement custom UsersMembershipProvider and turning off validation after user has successfully pass authentication. But the problem I can’t catch any appropriate event to turn on validation when user for example signs out from Umbraco.

     

     

    Can you please advise something on this? What is best practice to make request validation work with Umbraco?

  • Stefan Kip 1614 posts 4131 karma points c-trib
    Jan 03, 2014 @ 12:22
    Stefan Kip
    0

    That's a lot of information, but the essential part is missing; why is publishing not working? What's the exception / error message?

  • Arthur 6 posts 26 karma points
    Jan 03, 2014 @ 12:30
    Arthur
    0

    I'm sorry for missing key part of the question. The error message is the following:

    This error occurs when I click Save & Publish button

     

     

     

     

     

     

     

     

  • Stefan Kip 1614 posts 4131 karma points c-trib
    Jan 03, 2014 @ 12:45
    Stefan Kip
    0

    Hmm that's weird, I've never seen that exception before with umbraco.
    My 'default.aspx' contains 'validateRequest="false"' in the page directive, does yours too?

  • Arthur 6 posts 26 karma points
    Jan 03, 2014 @ 12:58
    Arthur
    0

    Nope. That the thing I worry about. I don't want to turn off request validation at all. I'm trying to find some solution to make it work with Umbraco.

  • Stefan Kip 1614 posts 4131 karma points c-trib
    Jan 03, 2014 @ 12:59
    Stefan Kip
    0

    Good luck with that, I don't think it's possible. Sounds to me like an application-wide configuration istead of path/user based.

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Jan 03, 2014 @ 14:01
    Sebastiaan Janssen
    0

    Do you have this in your web.config? <httpRuntime requestValidationMode="2.0" />

    Else, on which page (probably an iframe) do you get this error? You can add ValidateRequest="false" to that specific page without problem (Umbraco generally is configured that way for most backoffice pages).

  • Arthur 6 posts 26 karma points
    Jan 03, 2014 @ 14:34
    Arthur
    0

    Thanks for your answer. Yes I have this entry inside my web.config.

    I think I solve my problem. Additionally to ValidateRequest="false" directive I also add EnableEventValidation="false" to this page (Umbraco/editContent.aspx). 

Please Sign in or register to post replies

Write your reply to:

Draft