Copied to clipboard

Flag this post as spam?

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


  • Anthony Candaele 1197 posts 2049 karma points
    Mar 28, 2014 @ 15:23
    Anthony Candaele
    0

    How to access node from querystring

    Hi, is there a way in Razor to access a node through an id that was passed in a querystring?

    thanks for your help,

    Anthony

  • Jeavon Leopold 3074 posts 13631 karma points MVP 11x admin c-trib
    Mar 28, 2014 @ 15:30
    Jeavon Leopold
    100

    How about this?

    var myQuery = Request.QueryString["myQuery"];
    int myId;
    if (int.TryParse(myQuery, out myId))
    {
        var myNode = Umbraco.TypedContent(myId);
    }
    
  • Anthony Candaele 1197 posts 2049 karma points
    Mar 28, 2014 @ 15:44
    Anthony Candaele
    0

    Hi Jeavon, that works perfect, thanks a lot!

    Have a nice weekend and see you next month in Antwerp.

    greetings,

    Anthony

  • Jeavon Leopold 3074 posts 13631 karma points MVP 11x admin c-trib
    Mar 28, 2014 @ 15:47
    Jeavon Leopold
    0

    Perfect, see you in Antwerp!

    p.s. you just pushed my karma over 4k, didn't see that coming!!

  • Anthony Candaele 1197 posts 2049 karma points
    Mar 28, 2014 @ 16:04
    Anthony Candaele
    0

    well, here you go, glad I did something good this day.

Please Sign in or register to post replies

Write your reply to:

Draft