SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 ?

share|improve this question
up vote 3 down vote accepted

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, ...

share|improve this answer
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!

share|improve this answer
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 posting your answer, you agree to the privacy policy and terms of service.

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