---
title: CMSDocumentValue
---

> 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 CMSDocumentValue control displays a value from the data (columns) of the currently displayed Kentico page. You can place the control into:

- [ASPX page templates](https://docs.kentico.com/k9/developing-websites/developing-websites-using-aspx-templates.md)
- [ASCX layouts of portal engine pages](https://docs.kentico.com/k9/developing-websites/developing-websites-using-the-portal-engine/editing-page-layouts.md)
- [ASCX transformation](https://docs.kentico.com/k9/developing-websites/loading-and-displaying-data-on-websites/writing-transformations.md)

> **Note:** **Note**
>
> You can alternatively display page values through [macro expressions](https://docs.kentico.com/k9/macro-expressions.md). Use the **CurrentPageInfo** (or **CurrentDocument**) objects in macros to access the fields of the current page. You can place macros directly into text displayed on the website's pages.
>
> For example: {% CurrentPageInfo.DocumentName %}

## Getting started

The following tutorial shows how to display the page name of the currently selected page using the CMSDocumentValue control:

1. Create a new [ASPX page template](https://docs.kentico.com/k9/developing-websites/developing-websites-using-aspx-templates/creating-aspx-page-templates.md).
2. In Visual Studio, drag the **CMSDocumentValue** control from the toolbox onto the page template's form.
3. Set the following properties for the CMSDocumentValue control:

   - **AttributeName**: DocumentName
   - **FormattingString**: Document name: {0}

     ```html

     <cms:CMSDocumentValue ID="CMSDocumentValue1" runat="server" AttributeName="DocumentName" FormattingString="Document name: {0}" />

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

If you view the page on the website, the control displays the name of the currently selected page. In real-world scenarios, you would add the control to ASPX page templates that already have other functions, or into the code of page layouts when using the portal engine.

## Configuration

You can set the following properties for the CMSDocumentValue control:

| Property Name    | Description                                                                                                               | Sample value               |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------- | -------------------------- |
| AttributeName    | Name of the page field (column) whose value the control displays.                                                         | "DocumentName"             |
| ClassNames       | List of page types for which the control displays the value. You can add multiple page types separated by semicolons (;). | "cms.article;cms.menuitem" |
| FormattingString | .NET formatting expression used for displaying the value.                                                                 | "Name: {0}"                |
| StopProcessing   | If false, the control does not load or display any data.                                                                  |                            |
