---
title: CMSEditModeButtonAdd
related:
  - https://docs.kentico.com/k82/managing-website-content/configuring-the-environment-for-content-editors/enabling-on-site-editing.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

The CMSEditModeButtonAdd control displays a button that allows content editors to add new pages. The button only appears in the **Edit** mode of the **Pages** application and in [On-site editing mode](https://docs.kentico.com/k82/managing-website-content/configuring-the-environment-for-content-editors/enabling-on-site-editing.md).

## Getting started

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

1. Create a new [ASPX page template](https://docs.kentico.com/k82/developing-websites/developing-websites-using-aspx-templates/creating-aspx-page-templates.md).
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

```html

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

```

> **Info:** This tells the control what type of pages to create and sets the path of the page under which the pages are added.

4. Switch to the template's code behind and add the following references:

   ```csharp

   using CMS.PortalEngine;
   using CMS.Helpers;
   using CMS.Controls;

   ```
5. Add the following code to the **Page\_Load** method:

   ```csharp

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

   ```

   > **Info:** The code above is required if you wish to use the control individually on an ASPX page template.
6. 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 pages.

![](https://docs.kentico.com/docsassets/k82/cmseditmodebuttonadd/CMSEditModeButtonNew.png)

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

## Configuration

You can set the following properties for the CMSEditModeButtonAdd control:

| Property name  | Description                                                                                                                                                        | Sample value      |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------- |
| ClassName      | Specifies the [page type](https://docs.kentico.com/k82/developing-websites/defining-website-data-structure/page-types.md) that the control creates.                | "cms.article"     |
| Path           | Alias path of the parent page under which the control creates the new pages. If omitted, the control adds pages as child pages of the page containing the control. | "/whitepapers"    |
| StopProcessing | If true, the control stops all processing — does not load or display any data or other HTML output.                                                                |                   |
| Text           | 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](https://docs.kentico.com/k82/developing-websites/designing-websites-using-css.md) using the **CSS stylesheets** application.

You can apply stylesheets to:

- Entire websites
- Individual pages that contain the control
