How to: Create a Custom Action Specific to a List

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

You can create a custom action that is based on the list type by editing the elements.xml file that is associated with the custom feature. However, you can also create a custom action that is specific to a list rather than a list type. To do this, create a custom feature for the content type and then make a minor modification in the elements.xml file. The following steps demonstrate how to do this.

Create a custom content type

  1. Create a custom content type by inheriting from any one of the standard Windows SharePoint Services content types.

  2. Ensure that the identifier (ID) of your custom content type has the ID of the base content type (from which it inherits) as its ID prefix.

    The following example XML code shows the elements.xml file for a custom content type that was inherited from the standard Windows SharePoint Services content type, in this case, the List content type.

    <?xml version="1.0" encoding="utf-8" ?>
    <Elements xmlns="">
      <ContentType ID="0x01AB"
         Description="Customized Content Type"
        <FieldRef ID="{8c06beca-0777-48f7-91c7-6da68bc07b69}"
         DisplayName="Field1" />
        <FieldRef ID="{1df5e554-ec7e-46a6-901d-d85a3881cb18}"
         DisplayName="Field2" />

Create your custom action

  • In the Elements.xml file, create your custom action, as illustrated in the example following.

    <?xml version="1.0" encoding="utf-8" ?>
    <Elements xmlns="">
    <!-- Document Library Toolbar New Menu Dropdown -->
       <CustomAction Id="UserInterfaceLightUp.DocLibNewToolbar"
       <UrlAction Url="/_layouts/LightupHello.aspx?NewMenu"/>

Create the list

  1. Create the list where you want to render the custom action.

  2. Change the default content type of the new list to the custom content type that you created above.

  3. Delete the Item content type from the list. At this point, the custom action will be rendered in the Edit Control Block menu of the specified list.