The CMSEditModeButtonAdd control displays a button that allows content editors to add new documents. The button only appears in the Edit mode of the Pages application and in On-site editing mode.

Getting started

The following tutorial shows how to display a button that creates new news documents on an ASPX page template:

  1. Create a new ASPX page template.

  2. In Visual Studio, drag the CMSEditModeButtonAdd control from the toolbox onto the page template’s form.

  3. Set the following properties for the control:

    • ClassName: CMS.News
    • Path: /News

<cms:CMSEditModeButtonAdd ID="CMSEditModeButtonAdd1" runat="server" Path="/News" ClassName="CMS.News" />

This tells the control what type of documents to create and sets the path of the document under which the documents are added.

  1. Switch to the template’s code behind and add the following references:

     using CMS.PortalEngine;
     using CMS.Helpers;
     using CMS.Controls;
  2. Add the following code to the Page_Load method:

     // Registers the edit mode button script
     if (!PortalContext.ViewMode.IsLiveSite())
         ScriptHelper.RegisterClientScriptBlock(this, typeof(string), ScriptHelper.EDIT_DOCUMENT_SCRIPT_KEY, CMSControlsHelper.EditDocumentScript);

    The code above is required if you wish to use the control individually on an ASPX page template.

  3. Create a page based on the template in the Kentico administration interface.

If  you view the page in the Edit mode of the Pages application, the control displays a button that allows you to add news documents.

Clicking the button redirects you to the form where you can create the news document.


You can set the following properties for the CMSEditModeButtonAdd control:

Property name


Sample value


Specifies the document type that the control creates.



Alias path of the parent document under which the control creates the new documents. If omitted, the control adds documents as child documents of the page containing the control.



If true, the control stops all processing — does not load or display any data or other HTML output.


Sets the caption of the button. If not set, the default text is “Add new”.

“Add new article”

Appearance and styling

The appearance of the CMSEditModeButtonAdd control is determined by the CMSEditModeButtonAdd CSS class.

The recommended place to define the class is in a Kentico stylesheet using the CSS stylesheets application.

You can apply stylesheets to:

  • Entire websites
  • Individual documents (pages) that contain the control