smacca
asked on
How to recursively get parent nodes until top of tree is reached?
I have the following XML as example:
<Menu Name="home" Text="Home" NavigateUrl="/tmc" Visible="True" >
<Menu Name="sites" Text="Control Sites" NavigateUrl="/tmc/sites.as px" PageTitle="Monitor Control Sites" Visible="True">
<Menu Name="br" Text="Brisbane" NavigateUrl="locations.asp x?site=br" Visible="True">
....this can keep going 'n' levels deeper
</Menu>
</Menu>
</Menu>
Now, if I was in the deepest child node in the tree (for example sake), how can I recursively navigate to each parent node (ie parent of current, parent of current, parent of current and so on).
Cheers.
<Menu Name="home" Text="Home" NavigateUrl="/tmc" Visible="True" >
<Menu Name="sites" Text="Control Sites" NavigateUrl="/tmc/sites.as
<Menu Name="br" Text="Brisbane" NavigateUrl="locations.asp
....this can keep going 'n' levels deeper
</Menu>
</Menu>
</Menu>
Now, if I was in the deepest child node in the tree (for example sake), how can I recursively navigate to each parent node (ie parent of current, parent of current, parent of current and so on).
Cheers.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.