We are using SharePoint 2013 for intranet portal. Not apps.

We have a document library with documents. When we click on document ellipses then we want to add new menu item along with the existing items which will take the ID of this item and redirect to application page.

I would also like to know the number of possible ways to do this and the best practice.

  • Did you find more information about "the number of possible ways to do this and the best practice"? – zed Mar 14 '18 at 10:44

Add a Custom Action with location EditControlBlock

  Title="Name of action">
    <UrlAction Url="~/UrlOfPage?ListId={ListId}&amp;ItemId={ItemId}&amp;ItemUrl={ItemUrl}" />

A new menu item in ECB can be added by creating a user control and then registering it using AdditionalPageHead delegate control. First create a user control and add code similar to the below example to the ascx markup. The code below adds an item in ECB menu of a document library based on whether versioning is on or not in the library.

<script type="text/javascript">    
    function Custom_AddDocLibMenuItems(m, ctx) {
        AddECBMenuItems(m, ctx);

    function AddECBMenuItems(m, ctx) {
        var pageUrl = ctx.HttpRoot + "/_layouts/NY.ExportVersionHistory/ExportVersionHistory.aspx?ID=" + currentItemID + "&amp;List=" + ctx.listName;
        if (ctx.verEnabled) {
            CAMOpt(m, "Export Version History", "window.open('" + pageUrl + "');", "/_layouts/images/NY.ExportVersionHistory/Excel_Small.png");

Then create a Custom Action and register the above control using AdditionalPageHead delegate control.

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <Control Id="AdditionalPageHead"
           ControlSrc="~/_CONTROLTEMPLATES/15/NY.ExportVersionHistory/ECBDelegateControl.ascx" />

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.