06-27-05 10:51 PM
Simon Chalfont wrote:
> Hi,
>
> I'm writing an event handler for CmsPosting_Deleting. I want the code
> to do some checks and cancel out of the Deletion if necessary. I've
> seen that I can set "e.Cancel = true;" in order to back out of the
> deletion, however, I'm not sure how I can pass back a message to the
> user informing them why the action was cancelled. Any suggestions?
>
> Ideally, I'd like to populate some sort of Label (but I can't see how ot
> access the Page in question). Alternatively, could I throw a custom
> exception and allow MCMS to show it in the red box that appears by
> default for MCMS exceptions?
>
> Thanks in advance
Further to the above, if I don't set the SupressExceptionOnCancel flag
then a message appears in red text within the default console as thus:
Error Details:
Update operation cancelled. The current modifier method or property set
has been cancelled by a custom event handler.
Is there a way to customise this by overriding the
PublishingEventCancellationException? If so, how can I do this within:
public void CmsPosting_Deleting( Object sender, ChangingEventArgs e )
{
e.Cancel = true;
e.SuppressExceptionOnCancel = false;
..
}
[ Post a follow-up to this message ]
|