Redigera

Dela via


GenericWebPart(Control) Constructor

Definition

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

protected public:
 GenericWebPart(System::Web::UI::Control ^ control);
protected internal GenericWebPart (System.Web.UI.Control control);
new System.Web.UI.WebControls.WebParts.GenericWebPart : System.Web.UI.Control -> System.Web.UI.WebControls.WebParts.GenericWebPart
Protected Friend Sub New (control As Control)

Parameters

control
Control

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

Exceptions

control is null.

control is of type WebPart.

-or-

control has a null or empty ID property.

-or-

control has been output-cached.

Remarks

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.

Applies to

See also