Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

How to add a navigation node link that links to a folder inside a document library?

$
0
0

I'm trying to add a link in the Quick Launch to a folder inside my "Sample Documents" library. Linking to the document library is fine using this code:

SPNavigationNode node = new SPNavigationNode("Sample Documents", "Lists/Sample Documents", false);

node = web.Navigation.QuickLaunch.AddAsLast(node);

However, when I try to link to a folder "My Folder" inside the "Sample Documents" library, it gives me an exception that it cannot find that file or folder. I got the URL by observing the address when I try to view the folder using Windows Explorer (using Open with Explorer library functionality). My code looks like below:

SPNavigationNode node = new SPNavigationNode("My Folder", "Lists/Sample Documents/My Folder", false);

node = web.Navigation.QuickLaunch.AddAsLast(node);
What's the correct way to do it?




Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>