I created the following console app to add a node to one of my site collections. The code runs fine, and the node shows when looping thru all of the nodes (at the end of my method). However, that node does not show up in the Sharepoint UI. I'm sure I'm just missing a concept here. Thanks for your help.
using System; using Microsoft.SharePoint.Client; namespace SPNavigationNodeTest { class Program { static void Main(string[] args) { string siteUrl = "http://myServer/sites/mysitecoll/"; ClientContext clientContext = new ClientContext(siteUrl); Web site = clientContext.Web; // Get the top navigation node collection. NavigationNodeCollection colTopBar = site.Navigation.TopNavigationBar; // Set properties for a new navigation node. NavigationNodeCreationInformation ciNavigationNode = new NavigationNodeCreationInformation(); ciNavigationNode.Title = "New Node"; ciNavigationNode.Url = "/sites/mysitecoll/boarding/default.aspx"; // Create node as the last node in the collection. ciNavigationNode.AsLastNode = true; colTopBar.Add(ciNavigationNode); clientContext.Load(colTopBar); clientContext.ExecuteQuery(); Console.WriteLine("Current nodes:\n"); foreach (NavigationNode navNode in colTopBar) Console.WriteLine(navNode.Title); Console.ReadLine(); } } }