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 have created an elements.xml file to make a ribbon control for my test site but the control is not getting displayed on the ribbon. I am trying to look on a document library "shared documents" and below is my code.

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">

                <CommandUIDefinition Location="Ribbon.Documents.New.Controls._children">
                        LabelText="Click Me To Test"


                <CommandUIHandler Command="JSAlert"
                                  CommandAction="javascript:alert('hello world!');">


share|improve this question

2 Answers 2

You couldd try changing your CustomAction[Location] into Location="CommandUI.Ribbon". Example:

<CustomAction Id="YourRibbonButton" Location="CommandUI.Ribbon" Title="Your Button">

And perhaps try a lower Sequence, and also try removing the Registration* just to test.

share|improve this answer
Still not working, below is the changed code as per your suggestion. <CustomAction Id="CustomRibbonControlTest1" Location="CommandUI.Ribbon" Title="CustomRibbonControlTest1Title" > –  RHM Nov 15 '12 at 14:05
up vote 1 down vote accepted

I found out that I was working on a sandboxed solution and it was not deploying my code to the site. Dont know! why ? but when I created a new project with farm solution and pasted the same code, it worked!

share|improve this answer

Your Answer


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.