WebPartManager.WebPartDeleting Event


Occurs during the process of permanently deleting an instance of a dynamic WebPart or other server control from a WebPartZoneBase zone.

 event System::Web::UI::WebControls::WebParts::WebPartCancelEventHandler ^ WebPartDeleting;
public event System.Web.UI.WebControls.WebParts.WebPartCancelEventHandler WebPartDeleting;
member this.WebPartDeleting : System.Web.UI.WebControls.WebParts.WebPartCancelEventHandler 
Public Custom Event WebPartDeleting As WebPartCancelEventHandler 


The WebPartDeleting event is raised by the OnWebPartDeleting method, during the process of deleting a dynamic control (one that has been added programmatically or by a user through the Web Parts user interface). The event provides an opportunity to cancel the process before it is finished. If the deletion process is successfully completed, this event is followed by the WebPartDeleted event.

Page developers can provide custom handlers for the event by adding the OnWebPartDeleting attribute to the <asp:webpartmanager> element in a page, and assigning a custom method name to the attribute.

Applies to

See also