Compartir a través de


ControlBuilder.AppendSubBuilder(ControlBuilder) Método

Definición

Agrega generadores al objeto ControlBuilder para todos los controles secundarios que pertenecen al control contenedor.

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)

Parámetros

subBuilder
ControlBuilder

Objeto ControlBuilder asignado al control secundario.

Ejemplos

En el ejemplo siguiente se invalida el AppendSubBuilder método para iniciar si Exception el control que se aplica a este generador de controles intenta incluir controles en su instancia de ControlCollection clase.

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

Se aplica a

Consulte también