Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Bug in DeletingPage


When emptying Trash, this event occurs only once (not once per item, but once in total).

The event does not include the page being deleted, so it is not possible to do necessary cleanup-tasks when pages are deleted.

May 05, 2014 8:00


If you use IContentEvents.DeletingContent you should get an event args if the type DeleteContentEventArgs. That has a DeletedDescendents property, which should have the information you are looking for.

If you want to use the old page specific events, I think the same information can be found in eventArgs.Items["DeletedDescendents"].


Per Gunsarfs

May 05, 2014 9:33

You might as well use strongly typed e.DeletedDescendents. This code works for me:

protected void InstanceDeletingContent(object sender, DeleteContentEventArgs e)
            if (e.DeletedDescendents != null && e.DeletedDescendents.Any())
                foreach (var deleted in e.DeletedDescendents)
                    var deletedContent = ServiceLocator.Current.GetInstance<IContentLoader>().Get<IContent>(deleted);


May 05, 2014 20:42
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.