ControlBuilder.AppendSubBuilder(ControlBuilder) Metodo

Definizione

Aggiunge generatori all'oggetto ControlBuilder per qualsiasi controllo figlio che appartiene al controllo contenitore.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)

Parametri

subBuilder
ControlBuilder

Oggetto ControlBuilder assegnato al controllo figlio.The ControlBuilder object assigned to the child control.

Esempio

Nell'esempio seguente viene eseguito l'override del metodo AppendSubBuilder per generare una Exception se il controllo a cui viene applicato il generatore di controlli tenta di includere i controlli nell'istanza della classe ControlCollection.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.

// 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

Si applica a

Vedi anche