November Happy Hour will be moved to Thursday December 5th.

Validation on deleting page

Vote:
 
Hi, In certain cases I don't want a user to delete a page. In the EPDataFactory.DeletingPage event; how can I "stop" a user from deleting a page (if the specified validation failed). Thanks, Danie
#12636
May 16, 2006 11:53
Vote:
 
Have you read the documentation? You should be able to stop the deletion by setting e.CancelAction to true. Btw, make sure you're handling the correct event. When a page is "deleted" by the editor, it is moved to the wastebasket, and that triggers the MovingPage event. Also, you cannot set CancelAction to true in the DeletedPage and MovedPage events, as it is too late. EPiServer will simply ignore it. /Steve
#14650
May 16, 2006 20:27
Vote:
 
Hi, just read the SDK about deleting/moving a page (should have checked in the first place). The e.CancelAction = true; command works, but not visually. EPDataFactory.MovingPage += new EPiServer.PageEventHandler(EPDataFactory_MovingPage); private void EPDataFactory_MovingPage (object sender, PageEventArgs e) { e.CancelAction = true; }
#14651
May 17, 2006 17:55
Vote:
 
Hi, Just read the SDK about deleting/moving a pages (should have checked in the first place:). The e.CancelAction = true; command works, but not “visually”. EPDataFactory.MovingPage += new EPiServer.PageEventHandler(EPDataFactory_MovingPage); private void EPDataFactory_MovingPage (object sender, PageEventArgs e) { e.CancelAction = true; } When "Deleting" a page (moving it actually to recycle bin), the page still disappears, but when manually refreshing the tree, the item re-appear again (which is correct). Is there a way to stop the page to disappear and reappear again? I'm using version 4.60.1.165 Thanks
#14652
May 17, 2006 18:00
Vote:
 
#54281
Oct 07, 2011 15:41
* 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.