Copied to clipboard

Flag this post as spam?

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


  • Nathan Woulfe 422 posts 1580 karma points MVP 3x c-trib
    Sep 17, 2013 @ 05:51
    Nathan Woulfe
    0

    Get node id in usercontrol

    I'm probably missing something really obvious here, but have been having problems getting the id of the current page in the backoffice, within a usercontrol.

    Previously (and this still works, while obsolete), I've done this:

    var nodeId = umbraco.helper.Request("id");
    

    What is the equivalent in v6?

  • Jeroen Breuer 4861 posts 12138 karma points MVP 3x admin c-trib
    Sep 17, 2013 @ 12:43
    Jeroen Breuer
    101

    This wiki might help: http://our.umbraco.org/wiki/reference/api-cheatsheet/difference-between-node-and-document

    Since your in the backoffice you shoud use this code:

    var nodeId = Convert.ToInt32(HttpContext.Current.Request.QueryString["id"])

    Jeroen

  • Nathan Woulfe 422 posts 1580 karma points MVP 3x c-trib
    Sep 18, 2013 @ 00:53
    Nathan Woulfe
    0

    Thanks Jeroen, knew it would be something pretty simple that I was missing, works perfectly.

  • Jeroen Breuer 4861 posts 12138 karma points MVP 3x admin c-trib
    Sep 18, 2013 @ 09:23
    Jeroen Breuer
    0

    Could you please mark a post as the solution if it helped you?

    Jeroen

  • 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