Copied to clipboard

Flag this post as spam?

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


  • kevin 14 posts 35 karma points
    Nov 29, 2010 @ 11:08
    kevin
    0

    retrieve CurrentNode's parentId

    Hello,

    i need to retrieve CurrentNode's  parentId in .net usercontrol and not using xslt..

    here is the structure

    root(Content)

       --Home

                ---catergoryOne

                          --- subcat1a

                                 -- subcat1b

                                           --product(currentNode)

     

    i need to retrieve catergoryOne nodeid(parentNode of product) using product(which is  a currentNode).

    here the subcat levels(it may be 1,2 or 5) may vary.. any pointers folks?

    thank you

     

  • Rich Green 2246 posts 4008 karma points
    Nov 29, 2010 @ 12:46
    Rich Green
    0

    Hey Kevin,

    I would recommend getting hold of  Hendys API Helper class and using an XPATH statement http://blog.hendyracher.co.uk/umbraco-helper-class/ (this is now in uComponents)

    Your xpath would just need to look up the tree until it found the correct categoryOne docType.

    Rich

Please Sign in or register to post replies

Write your reply to:

Draft