Updating the url of a navigation node in moss programatically
Posted
by
78lro
on Stack Overflow
See other posts from Stack Overflow
or by 78lro
Published on 2009-09-21T11:06:01Z
Indexed on
2011/02/14
7:25 UTC
Read the original article
Hit count: 221
sharepoint
|navigation
Can anyone see why this should not work:
SPSite topNavigationSite = new SPSite("http://moss");
SPWeb topNavigationWeb = topNavigationSite.OpenWeb();
SPNavigationNodeCollection topNavigationBarNodes = topNavigationWeb.Navigation.TopNavigationBar;
SPNavigationNode updateNode = topNavigationBarNodes.Navigation.GetNodeByUrl("/about");
updateNode.Url = "";
topNavigationWeb.Update();
I can see debugging that the url get's set to "" but when the page renders, the navigation still shows the url as /about/default.aspx
I'm running this in page_load and expected it to update the moss database with the new url value.
© Stack Overflow or respective owner