Copied to clipboard

Flag this post as spam?

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


  • Mark Olbert 87 posts 117 karma points
    Oct 28, 2009 @ 01:30
    Mark Olbert
    0

    "Potentially Dangerous" Validation Error on Postback

    I have a wizard-based custom template page which posts back some html content. Naturally, ASPNET by default doesn't like this because it recognizes that the html might be dangerous.

    I thought I could solve the problem by including the following code:

            protected void Page_Init( object sender, EventArgs e )
            {
                ( (umbraco.UmbracoDefault) this.Page ).ValidateRequest = false;
            }

    in the code-behind for the template. I can't do this in the master file because you can't include the validation tag in the <%@ Master... directive.

    Page_Init() gets called every time there's a postback.

    Unfortunately, !#$^!#$(!@#$^@#! ASPNET still trips over the html content on postback.

    What am I doing wrong?

    - Mark

  • Mark Olbert 87 posts 117 karma points
    Oct 28, 2009 @ 03:08
    Mark Olbert
    0

    It turns out that setting ValidateRequest to false, and then deleting the current user resets ValidateRequest to true.

    - Mark

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies