Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using (SPWeb web = site.OpenWeb()) //Can user SPContext.Current.Web
- {
- SPNavigationNodeCollection quickLaunchNodes = web.Navigation.QuickLaunch;
- //Parent
- foreach (SPNavigationNode node in quickLaunchNodes)
- {
- string strParentTitle = node.Title;
- string strParentURL = node.Url.ToString();
- Console.WriteLine("Parent : " + strParentTitle + " : " + strParentURL);
- //Children
- SPNavigationNodeCollection children = node.Children;
- foreach (SPNavigationNode child in children)
- {
- string strTitle = child.Title;
- string strURL = child.Url.ToString();
- Console.WriteLine("Child : " + strTitle + " : " + strURL);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement