Copied to clipboard

Flag this post as spam?

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


  • Jonas Berling 30 posts 50 karma points
    Oct 04, 2011 @ 21:17
    Jonas Berling
    0

    Get request parameter without XSLT and Razor?

    Hi,

    I run Umbraco 4.5.2 and that, I guess, means that I don't have Razor. I would like to simply display a request parameter value in a page, i.e. in the template. It feels a bit silly to create an XSLT macro to just get the request parameter and display it. The old "classic" ASP way would be something like:

    <%= Request("myParam")%>

    I believe that it would be an easy thing with Razor, but is there a way to easily do it in 4.5.2?

    /Jonas

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Oct 04, 2011 @ 22:15
    Tom Fulton
    0

    Hi Jonas,

    You could use Inline XSLT on the umbraco:Item tag:

        <umbraco:Item field="pageName" runat="server" Xslt="umbraco.library:Request('myParam')"></umbraco:Item>

    The pageName field won't actually be shown since the XSLT doesn't use it anywhere, it's just there as a placeholder.

    -Tom

Please Sign in or register to post replies

Write your reply to:

Draft