2

I want to add an event to one of my quicklaunch items in SharePoint, but I don't know how to do that.

Or maybe to link the item to a page that would do what I want and then close and then come back to the previous one.

Do you have any idea how I can do this ?

2
  • Via code or UI?
    – Ryan
    Commented Jun 3, 2012 at 10:52
  • What exactly will the event do? I mean what kind of functionality do you want to add to the Quick launch menu? Commented Jun 4, 2012 at 2:01

2 Answers 2

1

Here is a visual guide that may help you: http://support.sherweb.com/Faqs/Show/how-to-add-a-link-to-the-quick-launch-toolbar-in-sharepoint-sharepoint-2010

-1

Here is a method to add an item to the quick launch in C#

private void AddNodeToQuickLaunch(string linkName, string SiteToOpen, string pathtoPage)
   {
       try
       {
           using (SPWeb web = SPContext.Current.Site.OpenWeb(SiteToOpen))
           {
               web.AllowUnsafeUpdates = true;

               SPNavigationNodeCollection nodes = web.Navigation.QuickLaunch;

               SPNavigationNode createNode = new SPNavigationNode(linkName, pathtoPage, true);

               foreach (SPNavigationNode node in nodes)
               {
                   bool nodeExists = false;
                   if (node.Title.Equals("Lists"))
                   {
                       foreach (SPNavigationNode child in node.Children)
                       {
                           if (child.Title == linkName)
                           {
                               nodeExists = true;
                           }
                       }

                       if (!nodeExists)
                       {
                           node.Children.Add(createNode, node);
                       }
                   }
               }
               web.AllowUnsafeUpdates = false;
           }
       }
       catch (Exception ex)
       {
           throw ex;
       }
   }
1
  • While this may theoretically answer the question, we prefer inclusion of the essential parts of the answer here, and to provide the link for reference. See answer for general guidelines. Also we require disclosure of any affiliation with products or websites. Please see May I promote products or websites I am affiliated with here? for guidelines.
    – SPDoctor
    Commented Jul 20, 2013 at 10:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.