I have an event receiver, which fires when item is being deleted ( ItemDeleting event ). I have some logic that checks whether item can be deleted or not, and if it can't, I need to show notification message - reason why item can't be deleted.

Now I would like to use SharePoint notifications, to have notification appear on the upper right corner, under the ribbons panel.

Any ideas how can I do that ? Or is it even possible ?


The only way you can get the call of the Javascript from the EventReceiver to the browser is through the SPEventPropertiesBase.RedirectUrl, but unfortunately you can't just specify javascript:... so you may have to:

  • Add something to your master page looking for a query parameter and showing the notification if that query parameter is present
  • In the EventReceiver set RedirectUrl to the original Url + the special query parameter

You should check it this code works as you want in all scenarios like when the users open an item in a dialog box (view/edit) and clicks delete, ...

  • Thanks, interesting approach. Requires few more cases to track ( as you mentioned, if user opens up dialog and deletes item from there ), but seems the only way to do that.
    – Michael
    Sep 3 '12 at 7:27

you might like to have a look at the below links, which should solve your purpose!



  • Thanks for links, I don't think alerts would work for me, what I intended to use is notifications, and second link you've provided is all about it, thou I'm looking for a way to use it from Event Receiver.
    – Michael
    Sep 2 '12 at 15:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.