ContentPlaceholder control

A ContentPlaceHolder control defines a relative region for content in a master page, and renders all text, markup, and server controls from a related Content control found in a content page.

A Content control is associated with a ContentPlaceHolder using its ContentPlaceHolderID property. Set the ContentPlaceHolderID property to the value of the ID property of the related ContentPlaceHolder control in a master page. More than one ContentPlaceHolder can be declared in a master page.

Within a content page, only one Content control can supply the content for a ContentPlaceHolder in the master page. However, in each content page that uses a master page, you can have separate Content controls associated with the ContentPlaceHolder. For example, you can define the ContentPlaceHolder for the page title in a master page. For each content page that uses the master page, you can add a Content control that supplies the text and markup for the page title.

Note

For XHtml compliance, an empty title element is created if a title has not been defined or cannot be found.

You can specify default content placed within the ContentPlaceHolder control tags, but this content is replaced by any content in an associated content page.

For more information about the ContentPlaceHolder control, see ContentPlaceHolder in the MSDN library.

See also

Concepts

ASP.NET standard controls

ASP.NET master pages overview