Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

WebPartManager.WebPartClosed Event

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

Occurs when a WebPart control (or server or user control) is removed from a page.

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

public event WebPartEventHandler WebPartClosed
/** @event */
public void add_WebPartClosed (WebPartEventHandler value)

/** @event */
public void remove_WebPartClosed (WebPartEventHandler value)

JScript supports the use of events, but not the declaration of new ones.

The WebPartClosed event indicates that a control has been successfully closed, either by a user or programmatically. 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 a page into catalog display mode, and add back to a page any controls that were previously closed.

The WebPartClosed event is associated with the OnWebPartClosed method, which both raises the event and provides a handler for it.

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.

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
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.