System.Web.UI.WebControls.Content Class

Holds text, markup, and server controls to render to a System.Web.UI.WebControls.ContentPlaceHolder control in a master page.

See Also: Content Members

Syntax

[System.Web.UI.ControlBuilder(typeof(System.Web.UI.WebControls.ContentBuilderInternal))]
[System.ComponentModel.Designer("System.Web.UI.Design.WebControls.ContentDesigner, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.ComponentModel.Design.IDesigner")]
[System.ComponentModel.ToolboxItem(false)]
public class Content : System.Web.UI.Control, System.Web.UI.INamingContainer

Remarks

A System.Web.UI.WebControls.Content control is a container for the content and controls of a content page. A System.Web.UI.WebControls.Content control is used only with a master page that defines a corresponding System.Web.UI.WebControls.ContentPlaceHolder control. A System.Web.UI.WebControls.Content control is not added to the control hierarchy at runtime. Instead, the contents within the System.Web.UI.WebControls.Content control are directly merged into the corresponding System.Web.UI.WebControls.ContentPlaceHolder control.

The System.Web.UI.WebControls.Content control is associated with a System.Web.UI.WebControls.ContentPlaceHolder using its Content.ContentPlaceHolderID property. Set the Content.ContentPlaceHolderID property to the value of the System.Web.UI.Control.ID property of a System.Web.UI.WebControls.ContentPlaceHolder control in a master page. When the URL of the content page is called, all text, markup, and server controls that are contained within the System.Web.UI.WebControls.Content control are rendered to the System.Web.UI.WebControls.ContentPlaceHolder on the master page, and the address bar of the browser will show the name of the content page.

For more information about master pages and content pages, see ASP.NET Master Pages Overview.

Declarative Syntax

Example

<asp:Content
    ContentPlaceHolderID="string"
    EnableViewState="

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0