GenericWebPart Constructor (Control)

 

Initializes a new instance of a GenericWebPart control by passing in a reference to a control that becomes the child control.

Namespace:   System.Web.UI.WebControls.WebParts
Assembly:  System.Web (in System.Web.dll)

new : 
        control:Control -> GenericWebPart

Parameters

control
Type: System.Web.UI.Control

A server control that becomes the child control of the GenericWebPart control instance.

Exception Condition
ArgumentNullException

control is null.

ArgumentException

control is of type WebPart.

- or -

control has a null or empty ID property.

- or -

control has been output-cached.

The GenericWebPart(Control) constructor is called by the WebPartManager control in its CreateWebPart method, to initialize an instance of a GenericWebPart control by passing in a reference to a child server control. After the GenericWebPart object is created, you can reference the child control using the ChildControl property.

.NET Framework
Available since 2.0
Return to top
Show: