Getting namespace error when creating a new ribbon custom action

Oct 19, 2012 at 8:05 PM

I am new to your software plug-in and recently installed and tried to create a new custom action for a ribbon. I am getting a namespace error right away stating "SubMenuTemplate" not found. How do I resolve this error? 

Here is a small snippet if the first method...

protected override void CreateChildControls()
        {
            /* use the following code to add child items to the menu */

            SubMenuTemplate menuSettings = new SubMenuTemplate();
            menuSettings.Text = "Custom Action OneNote";
            menuSettings.Description = "Description of Custom Action OneNote";
            menuSettings.ImageUrl = "/_layouts/images/SPSFCustomRibbon/CustomActionIcon_CustomActionOneNote.gif";

Coordinator
Oct 21, 2012 at 10:10 AM


SubMenuTemplate is a class in the  Microsoft.SharePoint.WebControls namespace.
It should be automatically included in the namespaces section of the class.

Have you checked if your reference in the project to Microsoft.SharePoint.dll is working?

Oct 22, 2012 at 2:28 PM

here are my references:

  • using System;
  • using System.Collections.Generic;
  • using System.Text;
  • using System.Web.UI.WebControls;
  • using Microsoft.SharePoint;
  • using Microsoft.SharePoint.WebControls;


My Solution Explorer:References include the following SharePoint assemblies:

  • Microsoft.SharePoint
  • Microsoft.SharePoint.Security


Am I missing anything?

Coordinator
Oct 28, 2012 at 9:33 PM

Sounds ok, as long as they are the SP2010 assemblies and not the SP2007. But as you want to do a Ribbon that is obvious I guess.

Unfortunately i cannot help you further with that. This is not SPSF related as the class is coming from the SharePoint dll and should be available. If not, then something else is wrong with your environment.