October 2010
Intermediate to advanced
1920 pages
73h 55m
English
If you don’t want to start from scratch when building a custom control, you can build a composite control. When you create a composite control, you create a new control from existing controls.
Every ASP.NET control has a Controls property that represents all its child controls. If you add child controls to a control, the child controls are automatically rendered when the parent control is rendered.
When you create a composite control, you typically override a control’s CreateChildControls() method. This method is called when a control builds its collection of child controls.
For example, the control in Listing 36.8 combines a TextBox control and RequiredFieldValidator control.
Listing 36.8. RequiredTextBox.cs
Read now
Unlock full access