07-27-05 10:52 PM
Hi,
if SuppressExceptionOnCancel is set then the exception is consumed silently.
So you will not see the error message of your exception.
You could present this error in a label control if you like.
Cheers,
Stefan
--
This posting is provided "AS IS" with no warranties, and confers no rights
New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
----------------------
<britman@gmail.com> wrote in message
news:1122469037.464657.221530@g43g2000cwa.googlegroups.com...
> Hi
>
> Hoping someone can help with this.
>
> I have the following code
>
> public void CmsPosting_Deleting(Object sender, ChangingEventArgs e)
> {
> if (e.Action==PublishingAction.Delete)
> {
>
> try
> {
> throw new Exception("You do not have authorisation.")
> }
> catch (Exception ex)
> {
> e.Cancel = true;
> e.SuppressExceptionOnCancel = true;
> WebAuthorErrorEventArgs error = new
> WebAuthorErrorEventArgs("FailedDelete",ex);
> error.Title = "Delete Declined";
> WebAuthorContext.Current.RaiseErrorEvent(error);
> }
> }
> }
>
> Which is basically hooking into the MCMS console delete event and
> trying to throw a custom error in the Console Error control when the
> user doesn't have authorisation to delete something. However when the
> code runs it seems to not display the error (the code does definately
> run) and returns to the parent channel of the posting that was selected
> to be deleted.
> If I dont set the e.SuppressExceptionOnCancel to true the standard
> error displays correctly so I was hoping someone could spot where I am
> going wrong???
>
> Thanks
>
[ Post a follow-up to this message ]
|