Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • gilpt 33 posts 53 karma points
    Jun 21, 2011 @ 10:44
    gilpt
    0

    hi ...

    does anyone have any idea why all events of the object "Document" are file correctly except of the

    Document

     

     

    .AfterDelete

     

    Document

     

     

    .AfterDelete += new Document.DeleteEventHandler(Document_AfterDelete);

     

    void

     

     

    Document_AfterDelete(Document sender, DeleteEventArgs e)

    {RemovePage(sender);}

     

    and nothing fired

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Jun 21, 2011 @ 11:00
    Lee Kelleher
    0

    Hi gilpt,

    Where are you putting this code?  Best bet is to put it in a class that inherits from "umbraco.BusinessLogic.ApplicationBase".

    Cheers, Lee.

    PS. Remember to make your post titles more descriptive - as "hi ..." might get ignored by other forum members.

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jun 21, 2011 @ 11:07
    Dirk De Grave
    1

    I'm not sure why it's not working, but may have heard this before. But from looking at the source code, think the event handler is only fired when document is being deleted permanently (ie deleted from recycle bin), which makes sense as the user may undelete it from the recycle bin. 

    So, depends what you want to do when a document gets deleted. You can subscribe to events to get notified when a document is being moved to the recycle bin...

     

    Hope this helps.

    Regards,

    /Dirk

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Jun 21, 2011 @ 11:10
    Lee Kelleher
    0

    Think Dirk nailed it here! :-)

    Try using the "AfterMoveToTrash" event - see if that works?

    Cheers, Lee.

  • gilpt 33 posts 53 karma points
    Jun 21, 2011 @ 11:42
    gilpt
    0

    thanks all , i needed the "AfterMoveToTrash" event

Please Sign in or register to post replies

Write your reply to:

Draft