I wired up the DeletedPage event in my Global.asax like this:
DataFactory.Instance.DeletedPage += this.Instance_DeletedPage;
And my handler:
private void Instance_DeletedPage(object sender, PageEventArgs pageEventArgs)
{
DeleteCustomerRoles(pageEventArgs.PageLink);
}
When I move a page to the wastebin, nothing fires of course since it is moved. When I delete the page from the wastebin - the event fires and I get the deleted page's PageLink in pageEventArgs
.
But... When I instead select the wastebin and clicks on the "Empty wastebin" button, I get the PageLink corresponding to the wastebin - not my deleted page!
Is this a feature or a bug? I see that there is some sort of list of linked pages on the page object in the pageEventArgs
, but I assume that all pages that are deleted (even children) will trigger the DeletedPage event. Is this not true?