Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
WebDeleting method

SPWebEventReceiver.WebDeleting method

Synchronous Before event that occurs before an existing Web site is completely deleted.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

public virtual void WebDeleting(
	SPWebEventProperties properties


Type: Microsoft.SharePoint.SPWebEventProperties

An SPWebEventProperties object that represents properties of the event handler.


properties is null .

Web site deletion events occur in the following cases:

  • The Web site is deleted through the user interface.

  • The folder that contains a Web site is deleted in an application that is compatible with Microsoft SharePoint Foundation (such as SharePoint Designer) through remote procedure call protocol (RPC).

  • The folder that contains a Web site is deleted through Distributed Authoring and Versioning (DAV).

Web site deletion events only occur for the first Web site in a chain of sites. For example, if a Web site at http://TopSite/Site, which has the subwebs http://TopSite/Site/Subsite1 and http://TopSite/Site/Subsite2, is deleted in , only one deletion event occurs, namely, for the http://TopSite/Site root Web site.

This event supports event cancellation and error messages.

Caution noteCaution

You should not use the property setting Status=CancelNoError to cancel an event, since doing so redirects the user to the noninformative "Delete Web" page.

© 2015 Microsoft