BeanSoftware Logo
 

 
ASP.NET Database Search Control
 
 

 
 Home
    Shop
    Advertise
    Write For Us
    Affiliate
    Newsletter
    Contact

How To Change Status Bar Text With ASP.NET?

Changing of web browser's status bar text can be useful in some scenarios. You can do this with JavaScript, but you can manipulate JavaScript with server side ASP.NET code. One of possible implementations could be code like this:

[ C# ]

public partial class DefaultCS : System.Web.UI.Page
{
    protected void Page_Load(object sender, System.EventArgs e)
    {
        // Create a message string
        string strMessage = "This is a message in status bar";
        // Register startup script to show a message in status bar
        this.RegisterStartupScript("SetStatusText", "<script>window.status='" +
            strMessage + "';</script>");
    }
}

[ VB.NET ]

Partial Class _Default
    Inherits System.Web.UI.Page
 
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        ' Create a message string
        Dim strMessage As String = "This is a message in status bar"
        ' Register startup script to show a message in status bar
        Me.RegisterStartupScript("SetStatusText", "<script>window.status='" & _
            strMessage & "';</script>")
    End Sub
End Class

 

window.status remarks

Note that this code needs JavaScript on client side. If visitor is disabled JavaScript, text in status bar will not be changed. Also, there is a problem with browser compatibility. It will work in Internet Explorer, but will not change status bar text in Firefox web browser.



Related articles:

1. Debugging with "Stepping" and "Data Viewing" features

FAQ toolbar: Submit FAQ  |  Tell A Friend  |  Add to favorites  |  Feedback



Copyright © 2002-2008 Bean Software. All rights reserved.