ControlBuilder.AppendSubBuilder(ControlBuilder) ControlBuilder.AppendSubBuilder(ControlBuilder) ControlBuilder.AppendSubBuilder(ControlBuilder) ControlBuilder.AppendSubBuilder(ControlBuilder) Method

Definition

Fügt dem ControlBuilder-Objekt Generatoren für alle untergeordneten Steuerelemente hinzu, die zu dem Containersteuerelement gehören.Adds builders to the ControlBuilder object for any child controls that belong to the container control.

public:
 virtual void AppendSubBuilder(System::Web::UI::ControlBuilder ^ subBuilder);
public virtual void AppendSubBuilder (System.Web.UI.ControlBuilder subBuilder);
abstract member AppendSubBuilder : System.Web.UI.ControlBuilder -> unit
override this.AppendSubBuilder : System.Web.UI.ControlBuilder -> unit
Public Overridable Sub AppendSubBuilder (subBuilder As ControlBuilder)

Parameter

subBuilder
ControlBuilder ControlBuilder ControlBuilder ControlBuilder

Das dem untergeordneten Steuerelement zugeordnete ControlBuilder-Objekt.The ControlBuilder object assigned to the child control.

Beispiele

Im folgenden Beispiel wird die AppendSubBuilder -Methode überschrieben, um eine Exception auszulösen, wenn das Steuerelement, auf das dieser Steuerelement-Generator angewendet ControlCollection wird, versucht, Steuerelemente in seine Instanz der-KlasseThe 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.

// 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.");
}
' Override the AppendSubBuilder method to throw an
' exception if the class it is applied to attempts
' to include child controls. 
Public Overrides Sub AppendSubBuilder(ByVal subBuilder As ControlBuilder)
    Throw New Exception( _
       "A custom label control cannot contain other objects.")
End Sub

Gilt für:

Siehe auch