WebPartManager.OnWebPartClosed Method

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

Raises the WebPartClosed event to signal that a control has been removed from a page.

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

protected:
virtual void OnWebPartClosed (
	WebPartEventArgs^ e
)
protected void OnWebPartClosed (
	WebPartEventArgs e
)
protected function OnWebPartClosed (
	e : WebPartEventArgs
)

Parameters

e

A WebPartEventArgs that contains the event data.

The OnWebPartClosed method raises the WebPartClosed event to indicate that a WebPart control (or other server or user control) has been successfully closed on a page.

To close a WebPart control means to remove it from a page so that it is not rendered, and also to place it in a special holding object called a page catalog. A page catalog, which corresponds to the PageCatalogPart control, maintains references to closed WebPart controls for each page. If a PageCatalogPart control is declared on a page within a CatalogZone zone, users can switch the page into catalog display mode, and add back to the page any controls that were previously closed.

The OnWebPartClosed method provides an opportunity for developers to create a custom handler for the WebPartClosed event. Page developers can add a custom handler for the event by adding an OnWebPartClosed attribute to the <asp:webpartmanager> element in a page, and then assigning a custom method name to the attribute. One useful task a developer might carry out in this method is to display a placeholder in place of the closed control, complete with a ToolTip that would inform users how to add the control back to the page.

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: