WebPartChrome.WebPartManager Property

Note: This property is new in the .NET Framework version 2.0.

Gets a reference to the current WebPartManager instance.

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

protected:
property WebPartManager^ WebPartManager {
	WebPartManager^ get ();
}
/** @property */
protected WebPartManager get_WebPartManager ()

protected function get WebPartManager () : WebPartManager

Property Value

A reference to the current WebPartManager on the Web page.

The WebPartManager property provides a reference to the current WebPartManager instance on the page.

This code example demonstrates use of the WebPartManager property. For the full code required to run the example, see the Example section of the WebPartChrome class overview topic.

The following code example uses the WebPartManager property to determine whether the current WebPart control being rendered is the selected control, which in this example means that the page is in edit view, and the control is currently being edited. If these conditions are true, the body of the control is not rendered, and a string is written in its place.

No code example is currently available or this language may not be supported.

If you load the Web page in a browser, you can switch the page into edit mode by selecting Edit in the Display Mode drop-down list control. You can click the edit verb in the verbs menu of either of the controls; when the page is rendered, the body of the control selected for editing is not rendered. However, if you drag the control into the empty zone labeled WebPartZone2, the body of the control is rendered. This is because the second zone is a standard WebPartZone zone, and it does not use the custom WebPartChrome class in this example to render the WebPart controls.

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show: