Copied to clipboard

Flag this post as spam?

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


  • Soeren Sprogoe 575 posts 259 karma points
    Jun 25, 2013 @ 12:55
    Soeren Sprogoe
    0

    Razor, Get Node by Url

    Hi,

    trying to "downgrade" myself from Xslt to Razor on an Umbraco v6.0.5 install, I've run into a problem:

    I've got a Url stored in a Dictionary item (don't ask why), fx. '/about/the-team.aspx', how do I find the actual node based on this?

    /SoerenS

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Jun 25, 2013 @ 13:42
    Jeavon Leopold
    100

    Hi,

    I beleive that uQuery is the only way to do this.

    Node node = uQuery.GetNodeByUrl("/home.aspx");

    More info on the documentation page for uQuery content

    Jeavon

  • Soeren Sprogoe 575 posts 259 karma points
    Jun 25, 2013 @ 14:08
    Soeren Sprogoe
    0

    Sweet, seems to work just fine! 

    Thanks!

Please Sign in or register to post replies

Write your reply to:

Draft