SharePoint 2010 and 2013 have a very useful control for displaying status messages, the SPPageStatusSetter.

The SPPageStatusSetter can be used to provide the end user messages in the same fashion that the SharePoint UI does to provide a more cohesive experience. The status bar comes in four flavors:

  • Blue – For informational type messages

  • Green – For success messages after an action

  • Yellow – For important warning messages (that aren’t error messages)

  • Red – For error messages

Since I use this a lot in my custom solutions, I have created a very simple helper class that I include in my projects so that I don’t need to repeat the same code over and over again:

To call the helper class to set the status, we just provide the Form object to add the element to and the message details:

Hopefully you find this as useful as I have!


Pin It on Pinterest

Share This
%d bloggers like this: