In this article we can explore a real world scenario in which a custom button has to be kept on the Ribbon UI.
You have a list named Expenses where the Amount column contains the expense amount. The list can contain multiple items. You need a button on the List > Library tab which on click will show the total of the Amount at any point of time.
The SharePoint Ribbon UI is extensible and we can create custom buttons on it. The button handler can be targeted for an:
1. ASPX Page
3. Third Party Page etc.
We can write custom code to manipulate the current list values, selected list values etc. so that additional flexibility is possible.
We need to create a Feature for this purpose.
Create a new project named ButtonOnRibbonUI as an Empty SharePoint project:
Choose the Deploy as Farm Solution option and click the Finish button.
We need a Feature to deploy our element. From the Solution Explorer, right click on the Features special folder and click the Add Feature item.
In this article we have explored how to create a custom button on the Ribbon UI. The attachment contains the source code we have discussed.