Nov 14, 2008 at 9:31 AM
Edited Nov 14, 2008 at 9:56 AM
Hi there,

I need to hook into the FileDeleted event and notify the user that if a file is being used in a ContentItem that they can't delete it. I can hook into the event via FileManager.FileDeleting, but I can't seem to find a way to notify the user, I thought maybe using javascript?

Anyone got any ideas?

Nov 14, 2008 at 11:55 AM

I think this thread has the info you need?
Nov 14, 2008 at 1:58 PM
Hi Martijn,

thanks for that pointer.

I didn't explain myself very well!

I have created an interceptor that subscribes to the event that I need. What I cannot do is notify the user that they can't delete a file.

Any idea on how to notify the user that they cannot delete a file, when I have caught and handled the FileDeleting event?

Nov 14, 2008 at 4:13 PM
I use this in one of my projects in the OnItemSaving method

        if (item.Parent != null)
            if (item.Parent.Name == "Trash")
                if (item.GetType() == typeof(PageItemTop) ||
                    item.GetType() == typeof(PageItemAdmin) ||
                    item.GetType() == typeof(PageItemHome)
                    e.Cancel = true;

Looks strange, but that does catch a delete (which is saving to the trash) an shows a page to the user.
Nov 15, 2008 at 5:04 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.