• 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);

    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

    Thursday, October 28, 2010 10:11 AM

All replies

  • What version of Internet explorer are you using?
    André Lage Microsoft SharePoint, CRM and Sybase Consultant
    Thursday, October 28, 2010 10:34 AM
  • Hi André

    I am using Internet Explorer 8, Version nr: 8.0.7600.16385



    Thursday, October 28, 2010 11:28 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:


    And I get the same result with you.


    Share your views.

    SharePoint 2010
    Monday, November 01, 2010 9:37 AM
  • Hi Wayne

    Does this mean that there is no way to fix it?


    Tuesday, November 02, 2010 1:29 PM
  • 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 3:58 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

    Friday, November 05, 2010 10:05 AM
  • Hi Soxiz,

    I download IE from this site:

    You can also try to create a Ribbon using XML, and check whether you can get the same result.


    SharePoint 2010
    Sunday, November 07, 2010 3:53 AM
  • 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:



    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load



    Dim status As New SPPageStatusSetter



    "Hello, world!", "I'm a status message!")






    End Sub


     protected void Page_Load(object sender, EventArgs e)




    SPPageStatusSetter status = new SPPageStatusSetter();



    "Hello, world!", "I'm a status message!");





    Does this work?


    Tuesday, November 16, 2010 7:17 PM
  • Did you include the sp.js script in your Masterpage?

    Here's an example:


    <SharePoint:ScriptLink ID="ScriptLink2" language="javascript" name="sp.js" OnDemand="true" runat="server" localizable="false" />
    Otherwise the Statusbar will not be displayed.


    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)};//]]>

    Tuesday, December 13, 2011 4:34 PM