In this Series of posts you will come to know about below two custom actions.
- Ribbon custom action
- Menu Item custom action
We have so many types of Custom Actions are there in SharePoint 2013
- Menu Custom Action
- Page Custom Action
- Central Administration Custom Action
- Server Ribbon Custom Action
In this Series of posts we post we will see how to add and Remove Menu(ECB) and Ribbon custom actions to different types of lists (Custom List, Document Library and Calendar) in SharePoint online using CSOM (.net managed) code.
Menu Custom Actions(ECB ) :
1) Take a empty web asp.net application and Add the Microsoft.SharePointOnline.CSOM nuget package to your solution using nuget Package Manager.
2)Add a web form (CustomActions.aspx) to the empty project.
3)Create a custom list in SharePoint online Site Collection say(SampleCustomList) and add some sample items in that.
4) Add the SharePoint online Site Collection URL,username and password in the web.config as below
5) Add a asp button(btn_clEcbCustomActions) in aspx form and also add the below code in the click event
Note: please refer the MSDN link for more details on Custom Action Custom Action Locations and IDs
6)Now run that web application and Click on the btn_clEcbCustomActions button.
7) Custom action is created successfully for the list in ECB menu
8) When you click on the custom action we will get an alert as defined in the newcustomaAction.Url property
9) For demo i had given the alert message for the URL property.
if we want to open a page in the popup, update the url property as below
10) Now the popup will come with the specified URL as below
Like this we can create ECB Menu custom actions for all type of lists in SharePoint online
In the Next article we will see how to create Ribbon action for lists in SharePoint Online
3 thoughts on “Custom Actions Using CSOM For SharePoint Online”
Nice Article.. looking forward for the next …
[…] the Previous post Custom Actions Using CSOM for SharePoint Online we had see how to create ECB menu for the lists in SharePoint […]
[…] the previous posts Part1 and Part 2 we have how to creat the custom actions. In this post we will see how to delete the […]