.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to create a new button in the ribbon

Posted By:      Posted Date: October 18, 2010    Points: 0   Category :SharePoint
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
 <CustomAction Id="Ribbon.List.Actions.AddAButton" Location="CommandUI.Ribbon" RegistrationId="100" RegistrationType="List" Title="My Custom Ribbon Button">
    <CommandUIDefinition Location="Ribbon.List.Actions.Controls._children">
     <Button Id="Ribbon.List.Actions.NewRibbonButton" Command="MyNewRibbonButtonCommand" LabelText="My custom button" TemplateAlias="o1"/>
    <CommandUIHandler Command="MyNewRibbonButtonCommand" CommandAction="javascript:alert('This is my custom button!');" />

With this code i create a new button in the ribbon:


And i get the following result:


How can i place my button inside a different tab or

View Complete Post

More Related Resource Links

SharePoint 2010 Central Admin--Create/Extend Web Application button on Ribbon are disabled


My Dev Environment is  SharePoint 2010 on WIN 7. I have 2 users

1) Built in Administrator- Member of FARM Administrator

2) Dinesh02\Dd – Also member of FARM Administrator

Now when I Sign-in with my account and use Manage Web Application link, on the Top Ribbon none of Button is enabled. I can not create Web APP nor Extend it.  When I select web application from list, some button are enabled but not all. Also I can see role as Contributor

This does not happen When I sign-in with Built-in\Administrator account.

Create user button in Create user wizard

Hey May i know how i can change postion of  Create user button in Create USer Wizard as i want to change according to requirement!!!

Customize Form button now showing up on ribbon

I used SP2010 Beta for 7 months and the Customize Form button was available on the ribbon for lists. Now, I am on the RTM, and cannot figure out how to show this button. Is it a feature? Do you have to have InfoPath 2010 installed locally? (I do have this, but just wondering). Thanks in advance.

How to display the edit button etc on the ribbon irrespective of who has checked it out

Is there a way that i can get the edit button etc displayed for all users irrespective of who has checked it out? Actually,i need the ribbon's edit,browse,page publish buttons active on the page even if somebody else has checked it out.I remember seeing an override checkout option available on the ribbon in some other site,But i do not have any such options displayed(I am also logged in and have full permissions).

How can i create a In-Ribbon Gallery?

i am trying to create something like the gallery in word used to select text styles. i am using the WPF Ribbon from here . i rea a tutorial somewhere that uses a combo box with the ribbon. <ribbon:RibbonComboBox Label="Gallery" SelectionBoxWidth="80"> <ribbon:RibbonGallery SelectedValue="1" SelectedValuePath="Content"> <ribbon:RibbonGalleryCategory> <ribbon:RibbonGalleryItem Content="ABC" /> <ribbon:RibbonGalleryItem Content="123" /> <ribbon:RibbonGalleryItem Content="Hello" /> </ribbon:RibbonGalleryCategory> </ribbon:RibbonGallery> </ribbon:RibbonComboBox> but i thats not really what i want

How to create some button template using WPF ?

Hi, I want to create some button template using WPF - The template will contain special button with the look and feel and special event that i need to my application. I don't understand if the i need to do it as ResourceDictionary or as user control and what is the different between them. And i also don't understand how can i add event to the ResourceDictionary ? Thanks for any help.

create RandomNumber from 1 - 100 by prssed random button

How I can create RandomNumber from 1 - 100 by prssed random button   can you help me as soon as possibel I have an assignment   Thanks Yousf  

Trim "New Quick Step" ribbon button

Hi all. I succesfully trimed two buttons from: Library Tools - Library - Cutomize Library using :  ribbon.TrimById("Ribbon.Library.CustomizeLibrary.EditList"); ribbon.TrimById("Ribbon.Library.CustomizeLibrary.EditDefaultForms");   Just cannnot find Control ID for "New Quick Step" button here: http://msdn.microsoft.com/en-us/library/ee537543.aspx Help, please. Thanks.  

Button in Ribbon.ListItem.New doesn't appear when list is added via a webpart


I have added a button to a project task list (id = 150).
Everything works fine when I directly use the list. But when I add the list via a webpart to the site page my new button is not available. It's exactly the same ribbon as in the list view but my new button is not visible. Any suggestions?

  Title="Ribbon Customization for a Content Type">
    <CommandUIDefinition Location="Ribbon.ListItem.New.Controls._children">

How to create a button with image and text


Currently I have button on a form and I need to make buttons image but maintain the click event functions that they have. For instance I have a button that says Update. Is there a way to add an image and put text in that image that says Update and maintain it's functionality. here is the code for the button:

<asp:Button ID="btnUpdate" runat="server" Text="Update" Visible="False" />


Hide ribbon, Hide site content/recycle button. Caledar overlay. Document publishing. Other questions


I have a 2010 farm operational and working well. I had a few questions.

(1) How to disable ribbons from appearing on the top (for anonymous sites).

(2) When I move the mouse over a tab in the top bar, how do I display a banner. It was easy enough in 2007, but I am not sure in 2010.

(3) I have disabled quick launch. But it still displays all site content and recycle bin. Is there a way to not to show those.

(4) Calendar overlay - Is this to display multiple calendars in one calendar using different colors to differentiate them. But if I had calendars in different site collections, then I guess due to the gallery boundary, I cannot calendars from multiple site collections.

(5) Document publishing - For some reason, this was easier in SPS 2007. I am not able to get it to work in 2010. Basically update a web page dynamically from a word document. Could anyone kindly provide a link. Also, would I be able to update a page in one site collection from a document from another site collection.

(6) Is it possible to move a folder/doc from one document library to another in one site collection (without webdav). Further, can I move a document library from one site collection to another.

Please advise. Sorry if I asked too many questions in the same post. I am newbie and this is my first post.



Ribbon Save Button Causes Validation


On a publishing site in 2010, it appears that the ribbon save button triggers validation on validators that have a specific validation group defined.  I'm confused as to how this happens, but it apparently does.

I have a web part with a simple input form and some validators.  When switching out of edit mode, the validators are triggered and the page won't switch back to normal view.

Any ideas?

create link button dynamically in gridview


Hi All,

I am trying  to add/insert linkbutton dynamically inside gridview row, below is the code

protected void Page_Load(object sender, EventArgs e)
        DataTable dt = new DataTable();
        DataColumn dcol = new DataColumn("Measure", typeof(System.String));

        DataColumn dcol1 = new DataColumn("ID",typeof(LinkButton));
        DataRow drow = dt.NewRow(); 

            LinkButton btn = new LinkButton();
            btn.ID = "testbtn";
            btn.Text = "1";
            btn.Visible = true;


            //drow = dt.Rows[0];

            drow[0] = "testmeasure";
            drow[1] = btn;

        catch{ }


        GridView1.DataSource = dt;


Problem I facing is that the data table is getting created fine with teh linkbutton as well but the gridview is not showing the linkbutton. upon executing I am only the column which is of string type.

Please help me in this case. what I am doing wrong? please help. this is urgent.


Connect to Outlook Ribbon button disabled /greyed



The Ribbon button is disabled for the List, i am using Sharepoint 2010 Enterprise Edition and all the Services are running as well. Outlook 2010 is also installed in it.

Any help will be appreciated.



Girish Tripathi Sharepoint 2010 Developer

Custom ribbon button that is visible "everywhere"



I am trying to create a custom ribbon button that will be visible whenever its parent group is present. For the moment the only way I can make it visible is if I explicitly type RegistrationId and RegistrationType under CustomAction. Removing either or both results in the button dissapearing.

Any help would be greatly appreciated! I have been googling for ages trying to find a solution.

My elements.xml file:

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

Create new page in asp.net on button click


There is a Textbox and a button when user clicks on the button after entering the data in the textbox I want that new page is created . The page must be .aspx Can anyone help !!!!!!!!!

Custom ribbon button on content type not shown in XsltListViewWebPart


Hello all,

As a bit of background: I'm currently busy developing a content type with some kind of status (waiting / in progress / done). I want to make the users life a bit easier to complete an item so I want to add a button to the ribbon that sets the selected items status to "Done".
This works when I go to the list and click on the item (I see my button and it works perfectly). The problem is that this button is not visible when I add a view of this list on the homepage, then suddenly my button does not show.

Does anybody know what can be done to also show the button inside the ribbon of the XsltListViewWebpart? Below is my elements.xml that I use.


<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  Title="Add a Ribbon Button">
     <Button Id="Ribbon.ListItem.Actions.NewRibbonButton"
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend