Setting status messages from the server side using SPPageStatusSetter

As you might know, in SharePoint 2010, you can add status messages in the OOB status bar that renders just below the ribbon and the top navigation menu. There are lots of useful blog posts and tutorials showing how you can achieve that in javascript using SharePoint 2010 UI Framework. However, there is almost no tutorials or enough documentation about SPPageStatusSetter class which enables you to add status messages and achieve the same level of control from the server side using the powerful .NET server side languages.

Here is how you can do that using C# , the code is self-explanatory.



And here is the result:



Also note that SPPageStatusSetter class is in Microsoft.SharePoint.WebControls namespace which means that it’s not available in SandBoxed solutions.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s