Copied to clipboard

Flag this post as spam?

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


  • Sebastiaan Janssen 5061 posts 15544 karma points MVP admin hq
    Oct 12, 2009 @ 16:09
    Sebastiaan Janssen
    0

    Does a datatype have knowledge of where it's used?

    I have a custom datatype and in it, I would like to look at the current node I'm editing, does the datatype know where it is during editing? Ideally I would like to do something like: 

    Document doc = new Document(currentPage.id);
  • Sebastiaan Janssen 5061 posts 15544 karma points MVP admin hq
    Oct 12, 2009 @ 16:10
    Sebastiaan Janssen
    0

    To clarify, I need to know this in the OnInit().

  • Richard Soeteman 4054 posts 12927 karma points MVP 3x
    Oct 12, 2009 @ 20:03
    Richard Soeteman
    0

    Hi Sebastiaan,

    The id is passed as the querystring parameter so int.parse(Request.Querystring["id"]) should be your friend.

    Cheers,

    Richard

  • Sebastiaan Janssen 5061 posts 15544 karma points MVP admin hq
    Oct 13, 2009 @ 09:15
    Sebastiaan Janssen
    0

    Well, that really was too easy! Thanks Richard, I ended up using:

    CMSNode currentNode = new CMSNode(((umbraco.cms.businesslogic.datatype.DefaultData)_data).NodeId);
  • 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