Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SPSecurity.RunWithElevatedPrivileges(delegate ()
- {
- using (SPWeb web = (SPWeb)properties.Feature.Parent)
- {
- Boolean found = false;
- SPNavigationNodeCollection nodes = web.Navigation.QuickLaunch;
- foreach (SPNavigationNode node in nodes)
- {
- if (node.Url.ToString() == "_layouts/15/ContractManager/ContractManager.aspx")
- {
- found = true;
- }
- }
- SPNavigationNode navNode = new SPNavigationNode("Contract Manager", "_layouts/15/ContractManager/ContractManager.aspx", true);
- if (found == false)
- {
- web.AllowUnsafeUpdates = true;
- nodes.AddAsLast(navNode);
- navNode.Update();
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement