You are here: Home » ByPass Error Page while canceling the event in Event Handler

ByPass Error Page while canceling the event in Event Handler

Posted by satheesh
No Comments »

          Actually, till some time back, i was searching for a way to bypass the error page, while canceling the event in event handler. In one of our application, when user deletes a item, event handler should cancel event, set a different status (so, that item will not processed in the application anymore). And user should not get the error page, according to the user, item is deleted.

         One of my friend, gave the solution in minutes. Though many of you might already know this, but i think it is worth putting in a blog.  Here is the simple code, which helps us doing that,

                       properties.Cancel = true;

                       properties.Status = SPEventReceiverStatus.CancelNoError;

  That's it, so simple. As most you might know that it works only in synchronous event.

Satheesh palaniswamy

    

Your email is never shared.
Required fields are marked *




Allowed tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>