WebPartManager.WebPartClosed 事件
定义
public:
event System::Web::UI::WebControls::WebParts::WebPartEventHandler ^ WebPartClosed;
public event System.Web.UI.WebControls.WebParts.WebPartEventHandler WebPartClosed;
member this.WebPartClosed : System.Web.UI.WebControls.WebParts.WebPartEventHandler
Public Custom Event WebPartClosed As WebPartEventHandler
事件类型
注解
此 WebPartClosed 事件指示控件已成功关闭,无论是由用户还是以编程方式。The WebPartClosed event indicates that a control has been successfully closed, either by a user or programmatically. 若要关闭某个 WebPart 控件,请将其从页中移除,使其不会呈现,还会将其放在称为页目录的特殊保存对象中。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. 对应于控件的页目录将 PageCatalogPart 维护对 WebPart 每个页面的已关闭控件的引用。A page catalog, which corresponds to the PageCatalogPart control, maintains references to closed WebPart controls for each page. 如果 PageCatalogPart 控件在区域内的某个页面上声明 CatalogZone ,则用户可以将页面切换到目录显示模式,然后再将其添加回某个页面。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.
WebPartClosed事件与方法相关联 OnWebPartClosed ,这两个方法都引发事件并为其提供处理程序。The WebPartClosed event is associated with the OnWebPartClosed method, which both raises the event and provides a handler for it.
页面开发人员可以为事件添加自定义处理程序,方法是将 OnWebPartClosed 属性添加到 <asp:webpartmanager> 页面中的元素,然后将自定义方法名称分配给该属性。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.