Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I need to add a new action button in the Site Actions menu for my site.

If I do this without a custom WebControl, it works, using an Element.xml file. However, I cannot get this to work with a WebControl, as I need to place it just above the New Page item.

My Elements.xml file

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction
    Id="BlueRing.SharePoint.NewProject"
    Location="Microsoft.SharePoint.StandardMenu"
    GroupId="SiteActions"
    Rights="ManageSubwebs"
    ControlAssembly="$SharePoint.Project.AssemblyFullName$"
    ControlClass="BlueRing.SharePoint.NewProject">    
  </CustomAction>
</Elements>

My WebControl class

namespace BlueRing.SharePoint
{
    public class NewProject
        : WebControl
    {
        protected override void CreateChildControls()
        {
            MenuItemTemplate item = new MenuItemTemplate();
            item.Text = "New Project";
            item.Description = "Creates a new Project site";
            item.ImageUrl = "/_layouts/images/BlueRing/projecticon.png";
            item.MenuGroupId = 200;
            item.Sequence = 201;
            item.ClientOnClickScript = "removed for legibility";
            this.Controls.Add(item);
        }
    }
}

When I deploy my feature and activate it, the menu item is not visible. I followed this example to the T, but still nothing.

share|improve this question

1 Answer 1

Resolved this, must be deployed via a Module and not a blank Elements.xml file.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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