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

Programmatically Add left navigation(Quick launch) link in SharePoint 2013 using SPNavigation Node

$
0
0

Hi

  I need to programmatically  add the left navigation link in Sharepoint 2013 page using webparts. For that am using the below code

                    SPWeb oweb = osite.OpenWeb();
                    oweb.AllowUnsafeUpdates = true;
                    SPNavigationNode newNode = new SPNavigationNode("Siva",http://msdn.microsoft.com, true);
                    newNode = oweb.Navigation.QuickLaunch.AddAsFirst(newNode);
                   newNode.Update();

The above code creates and add the link to the page. But i need to restrict that only the page containing the webpart(custom) should use the link not to all the pages. The above code creates the link throughout the site.

How to avoid/restirct/implement to use the created link for a specific page(i.e webpart deployed page alone).

Regards

Siva


Viewing all articles
Browse latest Browse all 25064

Trending Articles



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