London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!

Event On Block Deleted

Vote:
0

Hello,

 

I have a InitializeModule and I am able to handle an event on page deleted. I also see that they have an event on DeletedContent. But the DeleteContentEventArgs have a property Content but the BlockData doesn't inherit from it.

 

Regards,

 

Benjamin

#79618
Dec 23, 2013 9:13
Vote:
0

The Content property is IContent, which you can cast to your type. E.g.:

var block = e.Content as YourBlockData;

if (block != null)
{
    // Do something
}

Or just BlockData:

var block = e.Content as BlockData;

if (block != null)
{
    // Do something
}

    

 

#79651
Edited, Dec 27, 2013 4:07
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* 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.