Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
GenericWebPart Constructor

GenericWebPart Constructor

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)

protected internal GenericWebPart(
	Control control
)

Parameters

control
Type: System.Web.UI.Control

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

ExceptionCondition
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

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0
Show:
© 2015 Microsoft