ControlBuilder.AppendSubBuilder(ControlBuilder) Method

Definition

Adds builders to the ControlBuilder object for any child controls that belong to the container control.

C#
public virtual void AppendSubBuilder(System.Web.UI.ControlBuilder subBuilder);

Parameters

subBuilder
ControlBuilder

The ControlBuilder object assigned to the child control.

Examples

The following example overrides the AppendSubBuilder method to throw an Exception if the control this control builder is applied to tries to include controls in its instance of ControlCollection class.

C#
// Override the AppendSubBuilder method to throw an
// exception if the class it is applied to attempts
// to include child controls. 
public override void AppendSubBuilder(ControlBuilder subBuilder)
{
    throw new Exception(
        "A custom label control cannot contain other objects.");
}

Applies to

Produkt Verzie
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also