Before writing custom controls, you need to consider two issues:
1,What type of controls do you want to write?
The two basic types of custom controls are completely generated and combined controls. When building a fully generated control, you must specify all the controls from the beginning to render them toHtmlContent.
Creating a composite control is to bind existing controls to form a new control.
2,What classes should I inherit from?
You can derive a new control from an existing control.
When building basic controls, new controls are generally generated from the following base classes.
(1)System. Web. UI. Control
(2)System. Web. UI. webcontrols. webcontrol
(3)System. Web. UI. webcontrols. compositecontrol
System. Web. UI. ControlIs the base class of all controls,WebcontrolInherited fromControlClass, whileCompositecontrolClass inherits fromWebcontrolClass.
AllWebControls are from the base classSystem. Web. UI. webcontrols. webcontrolInherited.
ControlClass andWebcontrolThe difference between classes is thatWebcontrolControls derived from a class always have the start tag and end tag, and have more formatting options.