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

Can someone explain the difference?

Why I want to know:

I needed to use c# to create an alert and assign multiple users to it. I assume that would be SPWeb.Alerts.Add but they both seem to be the same & only take 1 user. In the end I created multiple identical user.alerts, 1 for each a user.

share|improve this question
up vote 0 down vote accepted

The only difference between calling SPWeb.Alerts.Add(...) and SPUser.Alerts.Add(...) that in case of SPWeb.Alerts.Add(...) alerts are created for current user.

Otherwise, there is no difference, for example, using the following calls:

web.Alerts.Add(tasks,SPEventType.All, SPAlertFrequency.Immediate);


web.CurrentUser.Alerts.Add(tasks, SPEventType.All, SPAlertFrequency.Immediate);

creates the same subscription record in Content DB.

share|improve this answer

There is actually no difference between using SPWeb.Alerts or SPUser.Alerts to add new alerts. They ultimately execute the same code on the backend to create the alert.

When making multiple alerts, you simply need to call one of the methods for each user you are creating the alert for.

share|improve this answer
BTW: You can see what code is being executed on the back-end by opening the Microsoft.SharePoint.dll assembly in .NET Reflector or some other reflector software. Useful when trying to figure out what SharePoint is doing. – John Chapman Jan 15 '13 at 18:41

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.