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 15523 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 15523 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 4052 posts 12925 karma points MVP 2x
    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 15523 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);
Please Sign in or register to post replies

Write your reply to:

Draft