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.