SPPageStatusSetter
-
Thursday, October 28, 2010 10:11 AM
Hello
I am trying to set a status message using the following code:
var statusSetter = new SPPageStatusSetter();
statusSetter.AddStatus("My Status Message: ", "This is my message", SPPageStatusColor.Red);
this.Controls.Add(statusSetter);In IE the message is displayed and then removed again, all within a second. Firefox display the message correct and do not remove it again.
Any idea why it don't work in IE?
Best regards
Mads
All Replies
-
Thursday, October 28, 2010 10:34 AMWhat version of Internet explorer are you using?
André Lage Microsoft SharePoint, CRM and Sybase Consultant
Blog:http://aaclage.blogspot.com
Codeplex:http://spupload.codeplex.com/http://simplecamlsearch.codeplex.com/ -
Thursday, October 28, 2010 11:28 AM
Hi André
I am using Internet Explorer 8, Version nr: 8.0.7600.16385
/Mads
-
Monday, November 01, 2010 9:37 AM
Hi Soxiz,
Thanks for your post.
I don’t think it’s problem of the SPPageStatusSett class, but the different ways for IE and FireFox to do with the Ribbon control.
I have just written a control using XML like this: http://www.sharepointnutsandbolts.com/2010/01/customizing-ribbon-part-1-creating-tabs.html
And I get the same result with you.
Share your views.
SharePoint 2010 -
Tuesday, November 02, 2010 1:29 PM
Hi Wayne
Does this mean that there is no way to fix it?
/Mads
-
Friday, November 05, 2010 3:58 AM
Hi Soxiz,
Sorry for my last reply. I have confused the Status message bar with the notification bar in Ribbon.
I have just written a web part, which has the same code with you. But I got different result with you. The status message bar worked fine.
So as what Andre said, it’s may be the problem of browser. The IE version is 8.0.7600.
Or are there some other web parts, which may cause the post back to the server, in the page?
SharePoint 2010 -
Friday, November 05, 2010 10:05 AM
Hi Wayne
Thank you for the answer.
I tried using the webpart on a empty SharePoint site, to be sure that nothing else would affect it.
What version of IE are you using and can you provide a download link to it?
Best regards
Mads -
Sunday, November 07, 2010 3:53 AM
Hi Soxiz,
I download IE from this site: http://www.microsoft.com/windows/internet-explorer/worldwide-sites.aspx
You can also try to create a Ribbon using XML, and check whether you can get the same result.
SharePoint 2010 -
Tuesday, November 16, 2010 7:17 PM
Both IE 9.0.7930.16406 Beta and IE 8.0.7600.16385 work for me. I created a visual Web Part and have the following code in Page_Load:
VB:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
Dim status As New SPPageStatusSetter
status.AddStatus(
"Hello, world!", "I'm a status message!")
Me.Controls.Add(status)
End Sub
C#:
protected void Page_Load(object sender, EventArgs e)
{
SPPageStatusSetter status = new SPPageStatusSetter();
status.AddStatus(
"Hello, world!", "I'm a status message!");
this.Controls.Add(status);
}
Does this work?
-Dallas
-
Tuesday, December 13, 2011 4:34 PM
Did you include the sp.js script in your Masterpage?
Here's an example:
Otherwise the Statusbar will not be displayed.<SharePoint:ScriptLink ID="ScriptLink2" language="javascript" name="sp.js" OnDemand="true" runat="server" localizable="false" />
Another issue could be that the functionality 'Hide Ribbon' is active. This will place the following line into the output, which clears all statusses when document is ready.
document.onreadystatechange=fnRemoveAllStatus; function fnRemoveAllStatus(){removeAllStatus(true)};//]]>- Edited by Koen van der Linden Thursday, December 15, 2011 12:17 PM

