TemplateControl.LoadControl Method (Type, Object)
Loads a Control object based on a specified type and constructor parameters.
Assembly: System.Web (in System.Web.dll)
- Type: System.Type
The type of the control.
- Type: System.Object
An array of arguments that match in number, order, and type the parameters of the constructor to invoke. If parameters is an empty array or null, the constructor that takes no parameters (the default constructor) is invoked.
When you load a control into a container control, the container raises all of the added control's events until it has caught up to the current event. However, the added control does not catch up with postback data processing. For an added control to participate in postback data processing, including validation, the control must be added in the Init event rather than in the Load event.