Wednesday, December 9, 2015

Programmatically Create SharePoint Toplink bar and Quicklaunch bar in SharePoint 2010 and 2013

Programmatically Create TopLink Bar in SharePoint site collection:

SPNavigationNodeCollection topnav = oweb.Navigation.TopNavigationBar;
SPNavigationNode node = new SPNavigationNode("Title", "URL");
node = topnav.AddAsLast(node);
node.Update();


Similarly, To create Quicklaunch bar

SPNavigationNodeCollection topnav = oweb.Navigation.QuickLaunch;
SPNavigationNode node = new SPNavigationNode("Title", "URL");
node = topnav.AddAsLast(node);
node.Update();

No comments:

Post a Comment