Summary : “Status Bar” in SharePoint 2013, How to Create “Status Bar” in SharePoint 2013,Create a Status in Status bar using SPPageStatusSetter
“Status Bar” in SharePoint 2013 is not dead but kind of hidden because of the new minimal UI of SharePoint 2013. Similar to SharePoint 2010 the class SP.UI.Status in SharePoint 2013 provides the following methods to work with Status bar.
1. addStatus – Method that allows you to pass a title, the HTML payload, and a Boolean specifying whether to render the message at the beginning of the status bar.
2. appendStatus – Method that appends status to an existing status. You need to pass the status ID, title, and HTML you want the new status appended to.
3. updateStatus – Updates an existing status message.You need to pass the status ID and the HTML payload for the new status message.
4. setStatusPriColor – Allows you to set the priority color to give a user a visual indication of the status message’s meaning.
5. removeStatus – Removes the status specified by the status ID you pass to this method from the status bar.
6. removeAllStatus – Removes all status messages from the status bar.
SP.UI.Status.addStatus("New msg","Adding New Staus to SharePoint 2013 Status bar");
Once you add this status build and deploy your application page to view the added Status in Status bar.
Code Behind –
If you want to add a Status to a Page using the Code behind, you can do that using the SPPageStatusSetter class. Add the following code in the code behind of your Application page.
SPPageStatusSetter newStatusCtl = new SPPageStatusSetter();
String msg = "This is an example of SharePoint 2013 Status Bar";
newStatusCtl.AddStatus("New msg", msg, SPPageStatusColor.Blue);
The Code should look something like below
Next Build and deploy the project.The application page should contain a new Status Bar something like below.
See more SharePoint 2013 Development Samples at SharePoint 2013 Developer Tutorials and Samples