Copied to clipboard

Flag this post as spam?

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


  • Kilgore Trout 2 posts 71 karma points
    Dec 16, 2016 @ 17:19
    Kilgore Trout
    0

    Umbraco query string anchor link

    I would like to return the user to a certain anchor but my querystring keeps getting encoded. So I'm doing this

    return RedirectToCurrentUmbracoPage($"?success={success.ToString().ToLower()}"+"#sentletter");
    

    with the goal of returning

    ?success=true#sentletter
    

    but it sends back

    ?success=true%23sentletter
    

    I tried several encodings and decodings but it doesn't seem to do anything

    thanks

  • Jeff Subat 28 posts 159 karma points
    Mar 10, 2017 @ 01:23
    Jeff Subat
    0

    I had the same issue. I replaced this:

    return RedirectToCurrentUmbracoPage();
    

    With this:

    var url = CurrentPage.Url + "#MyElementId";
    return Redirect(url);
    

    I haven't tested it thoroughly, but it seems to be working.

Please Sign in or register to post replies

Write your reply to:

Draft