TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
muthukumar Durai
NA
20
9.2k
hide top navigation child node in sharepoint 2013 using c#
Jan 14 2016 12:50 AM
private void HideTopNavigation()
{
SPSecurity.RunWithElevatedPrivileges(delegate()
{
using (SPSite Osite = new SPSite(SPContext.Current.Site.ID))
{
using (SPWeb Oweb = Osite.OpenWeb())
{
SPNavigationNodeCollection topNavNodes = Oweb.Navigation.TopNavigationBar;
foreach (SPNavigationNode node in topNavNodes)
{
if (node.Title == "Org Browser")
{
if (node.Children.Count > 0)
{
foreach (SPNavigationNode childNode in node.Children)
{
if (childNode.Title == "Official")
{
childNode.IsVisible = false;
using (SPSite oSite = new SPSite(SPContext.Current.Site.Url + childNode.Url))
{
using (SPWeb ospWeb = oSite.OpenWeb())
{
ospWeb.AllowUnsafeUpdates = true;
PublishingWeb oPub = PublishingWeb.GetPublishingWeb(ospWeb);
oPub.IncludeInCurrentNavigation = false;
oPub.Update();
ospWeb.Update();
ospWeb.AllowUnsafeUpdates = false;
}
}
Oweb.AllowUnsafeUpdates = true;
childNode.Update();
Oweb.AllowUnsafeUpdates = false;
}
}
}
}
}
}
}
});
}
i use this for hide that but it not working
Reply
Answers (
0
)
central admin image not open properly in sharepoint 2013
ShaprePoint 2013 schedule email workflow