System.Web.UI.WebControls.CompositeControl Class

Implements the basic functionality required by Web controls that contain child controls.

See Also: CompositeControl Members


[System.ComponentModel.Designer("System.Web.UI.Design.WebControls.CompositeControlDesigner, System.Design, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.ComponentModel.Design.IDesigner")]
public abstract class CompositeControl : WebControl, System.Web.UI.INamingContainer, ICompositeControlDesignerAccessor


The System.Web.UI.WebControls.CompositeControl class is an abstract class that provides naming container and control designer functionality for custom controls that encompass child controls in their entirety or use the functionality of other controls. This class is inherited by controls such as System.Web.UI.WebControls.Login, and System.Web.UI.WebControls.Wizard. You cannot use this class directly.

The System.Web.UI.WebControls.CompositeControl class implements the System.Web.UI.INamingContainer interface. This is required to ensure that all child control ID attributes are unique, and can be located on post back for data binding.

To create a custom composite control, derive from the System.Web.UI.WebControls.CompositeControl class. The functionality this class provides is built-in verification that child controls have been created prior to being accessed and it enables the design-time environment to recreate the collection of child controls. The CompositeControl.Controls property ensures that all child controls have been created prior to accessing the System.Web.UI.ControlCollection. The CompositeControl.DataBind method verifies that all child controls have been created prior to binding them to a data source.

Control developers can use the System.Web.UI.Design.WebControls.CompositeControlDesigner class to create a custom designer for a composite control derived from System.Web.UI.WebControls.CompositeControl. A control designer is a class that defines how a control is displayed and manipulated in design view. For more information, see System.Web.UI.Design.WebControls.CompositeControlDesigner.


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