Wednesday, April 10, 2013

Update links to Top Navigation Sharepoint 2010 programmatically

Update links to Top Navigation Sharepoint 2010 programmatically

using (SPSite siteSuzuki = new SPSite("http://yourwebapp/sites/Suzuki"))
                {
                    SPWeb objWeb = siteSuzuki.OpenWeb();
                    SPNavigation _navigation = objWeb.Navigation;
                    SPNavigationNodeCollection _navNodes = _navigation.TopNavigationBar;

                    foreach (SPNavigationNode item in _navNodes)
                    {
                        if (item.Title == txtOldGlobalNavigationName.Text)
                        {
                            item.Title = txtNewGlobalNavigation.Text;
                            item.Update();
                        }
                    }
                    objWeb.Update();
                    //litError.Text += " Site URL: " + site.Url + ">> Site Name: " + site.OpenWeb().Title; ;
                }

2 comments:

  1. Great article ...Thanks for your great information, the contents are quiet interesting. I will be waiting for your next post.
    SharePoint 2013 Online Training in Hyderabad

    ReplyDelete
  2. This article is really fantastic and thanks for sharing the valuable post.
    Sharepoint Online Training | Dynamics AX Online Training

    ReplyDelete