ControlBuilder.AppendSubBuilder(ControlBuilder) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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)
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.
// 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
Applies to
See also
Співпраця з нами на GitHub
Джерело цього вмісту можна знайти на GitHub, де також можна створювати й переглядати запитання та запити на внесення змін. Докладні відомості наведено в нашому посібнику для співавторів.