I want to show a status bar that needs to be persistent on a page. for this I used the following in my master page
function ShowStatusBarMessage(title, message)
{
var statusId = SP.UI.Status.addStatus(title, message, true);
SP.UI.Status.setStatusPriColor(statusId, 'yellow'); /* Set a status-color */
}
HTML, call the JS method:
<a onclick="ShowStatusBarMessage('Title'!','Awesome message!')">
Display Status Bar message!
</a>
ref:
http://www.zimmergren.net/archive/2010/03/17/sp-2010-dynamically-displaying-messages-to-your-users-with-the-notification-and-status-bar-areas-in-sharepoint-2010.aspx
But what I want is
to call the function on load. So I used pushed ny function to _spBodyOnLoadWrapper using _spBodyOnLoadFunctionNames.push("YourFunctionName");,
it throws an error 'SP.UI.Status' is null or not an object
Next I created and
deployed a webcontrol and did a registerclientscript, that too gives me 'SP.UI.Status' is null or not an object
// Define the name and type of the client scripts on the page.
String csname1 = "AlertScript";
Type cstype = this.GetType();
// Get a ClientScriptManager reference from the Page class.
ClientScriptManager cs = Page.ClientScript;
// Check to see if the startup script is already registered.
if (!cs.IsStartupScriptRegistered(cstype, csname1))
{
View Complete Post