I'm trying to create a custom action that does a postback when clicked.

I've followed the following articles with no luck whatsoever:

  1. http://makarandrkulkarni.blogspot.com/2010/01/sharepoint-2010-ribbon-customization_09.html

  2. http://blog.dennus.net/2010/07/20/ribbon-buttons-with-postback-in-sp2010/

  3. https://docs.microsoft.com/en-us/archive/blogs/sridhara/implementing-a-post-back-button-in-a-sharepoint-2010-web-part-with-contextual-ribbon

Frankly, article 3 is a ridiculous amount of work just to do a postback so I didn't even attempt it.

I've managed to get the button on the ribbon but without the CommandUIHandler element in the elements.xml the button is forever disabled.

Anyway, this is what I'm trying to achieve:

I have an external list. I want a custom action on the list that updates a field in another database when it is clicked. Now, this doesn't have to be via a postback, I am open to any suggestions anyone has - I just thought doing a postback would be simple, obvisouly I was wrong. This, so I've heard was stupidly easy in SP 2007.

Thanks in advance for any help/suggestions.

2 Answers 2


If it is a single administrative action, you can simply use SharePoint Designer for creating a ribbon button: http://msdn.microsoft.com/en-us/library/ee558387.aspx

For performing your field update, you can then use workflow or Application Page with query string parameters.

If you need reusable solution (for wsp), I recommend you to use SharePoint 2010 Fluent Ribbon API. It is a codeplex project, which simplifies operations with ribbon.

You can run any JS on ribbon button click.

For further details, please, visit the project's documentation site.

About the postback solution:

Most likely, postback is not a good way here, because AllItems form of an External list is not a page with your code behind. And to get this postback to work, you will need some extra magic, for example, you can deploy your own webpart on the same page and when you can use __doPostBack from javascript, and this.Page.Request["__EVENTTARGET"] from your code. I don't recommend you to use this solution, even if it is possible.

  • The SharePoint 2010 Fluent Ribbon API is amazing. Thank you for sharing this!
    – Jamie
    Apr 27, 2011 at 8:18

It can still be easy depending on what you want to do. SharePoint Designer supports the ability to add custom actions to the Ribbon menu without having to write any code that can navigate to a form (with query parameter tokens), start a workflow, or open any url and it provides a simple dialog UI for customizing the button.

  1. Open SharePoint Designer
  2. Open any List or Library
  3. Find the Custom Actions area on the designer page
  4. Add new Custom Action...

You can also initiate adding a new Ribbon button directly from the SharePoint UI. Navigate to a list or library (with designer permissions), and click "New Quick Step" from the Ribbon menu. This will open SharePoint Designer.

I hope this helps. If you want to see how they are doing it, you can save the site as a template and import it into Visual Studio. This of course assumes that you do not need to combine client-side processing and then invoke a post-back from client-side.

If you need to force a post-back from a JavaScript stub, the easiest way is to just find the ASPNET form node (SharePoint pages only have a single form instance) and do a submit. Let me know and I can probably find a quick sample.

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.