Copied to clipboard

Flag this post as spam?

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


  • Adam 2 posts 72 karma points
    Nov 01, 2016 @ 10:21
    Adam
    0

    read parameters after # in url

    www.mysite.com/blog?id=123 can read the parameter(id) value in macro partial view.

    www.mysite.com/blog/#id=123 can't read the parameter(id) value in macro partial view and it display empty macros.

    In macro,

    if (System.Web.HttpContext.Current.Request["id"] != null) { c = System.Web.HttpContext.Current.Request["id"]; }

    In Template, placing the macro

    <umbraco:macro ID="Macro3" Alias="blogListing" runat="server"></umbraco:Macro>
    
  • Yakov Lebski 591 posts 2346 karma points
    Nov 01, 2016 @ 21:48
    Yakov Lebski
    0

    parameters in hash tag (#) is not read by server, it's client side operation.

  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    Nov 02, 2016 @ 07:21
    Dave Woestenborghs
    0

    Hi Adam,

    Yakov is right. A querystring should start with a ? otherwise it's not recognized as query paramenter serverside.

    The # is pointer to a anchor on your page. This is never sent to the server.

    Dave

  • Adam 2 posts 72 karma points
    Nov 02, 2016 @ 10:36
    Adam
    0

    Thank u guys for your response

Please Sign in or register to post replies

Write your reply to:

Draft