Copied to clipboard

Flag this post as spam?

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


  • [email protected] 378 posts 1915 karma points MVP 4x c-trib
    Mar 18, 2013 @ 10:56
    jeffrey@umarketingsuite.com
    0

    GetCurrentNode in Umbraco 6

    Hi all,

    I'm started using Umbraco 6 today and I was wondering how I could get the current node in my .NET-codefile. I used to do it (in Umbraco 4) like

    Node nThisNode = Node.GetCurrent();

    but I was wondering if this is still the correct way, because the introduction of the ContentService in V6.

    Hope somebody can help me out,

    Jeffrey

  • Jeroen Breuer 4861 posts 12138 karma points MVP 3x admin c-trib
    Mar 18, 2013 @ 11:30
    Jeroen Breuer
    0

    The ContentService is for creating new content. Not fetching existing content. You can use IPublishedContent for that: http://our.umbraco.org/documentation/Reference/Mvc/querying

    Jeroen

  • Jeroen Breuer 4861 posts 12138 karma points MVP 3x admin c-trib
    Mar 18, 2013 @ 11:32
    Jeroen Breuer
    0

    Here is some more info about getting the current node: http://issues.umbraco.org/issue/U4-1528

    Jeroen

  • [email protected] 378 posts 1915 karma points MVP 4x c-trib
    Mar 18, 2013 @ 11:39
    jeffrey@umarketingsuite.com
    0

    Hi Jeroen,

    thanks for the quick feedback! But how would I do this in WebForms syntax (instead of MVC)?

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies