I've got a media item, and I want to add some business logic that it can't be deleted if it's related to some other (custom) tables. If the delete is canceled I'd like to inform the user the delete action has been canceled. Can I call the speechBubble method or some other javascript method to inform the user? My code now looks like this:
public class ProjectApplicationBase : ApplicationBase { public ProjectApplicationBase () { #region Events
Media.BeforeDelete += new Media.DeleteEventHandler(Media_BeforeDelete);
SpeechBubble during delete event.
Hello,
I've got a media item, and I want to add some business logic that it can't be deleted if it's related to some other (custom) tables. If the delete is canceled I'd like to inform the user the delete action has been canceled. Can I call the speechBubble method or some other javascript method to inform the user? My code now looks like this:
public class ProjectApplicationBase : ApplicationBase
{
public ProjectApplicationBase ()
{
#region Events
Media.BeforeDelete += new Media.DeleteEventHandler(Media_BeforeDelete);
#endregion
}
protected void Media_BeforeDelete(Media sender, umbraco.cms.businesslogic.DeleteEventArgs e)
{
int countValue = Convert.ToInt32(sender.getProperty("mediaCount").Value);
if (countValue > 0)
{
//Some code to show a pop-up the item has not been deleted.
e.Cancel = true;
}
}
}
Jeroen,
Check Richard's blog and the codeplex item (And vote for it!)
Cheers,
/Dirk
Thanks Dirk, I voted for the workitem. Hope it will be available soon (4.1).
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.