Copied to clipboard

Flag this post as spam?

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


  • Nauman 98 posts 118 karma points
    Mar 05, 2010 @ 12:27
    Nauman
    0

    getting childnodes of a specific parent node

    Hi

    I am working in nodefactory in my own usercontrols. I have a parent node "1072", how can I get all the nodeids (and names) of this parent node in my c# code?

    Nauman

  • Thomas Höhler 1237 posts 1709 karma points MVP
    Mar 05, 2010 @ 12:41
    Thomas Höhler
    0

    You can iterate through all the children of this node via :

    umbraco.presentation.nodeFactory.Node parentNode = new umbraco.presentation.nodeFactory.Node(1072);
    foreach (umbraco.presentation.nodeFactory.Node node in parentNode.Children)
    {
    ...
    var id = node.Id;
    var nodeName = node.Name;
    }

    hth, Thomas

     

  • Nauman 98 posts 118 karma points
    Mar 05, 2010 @ 14:11
    Nauman
    0

    Thank Thomas, you always provide a great help.

    Cheers

    Nauman

Please Sign in or register to post replies

Write your reply to:

Draft