DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: Change message on Status Bar

  1. #1
    Steve Guest

    Change message on Status Bar


    Hi All,
    How can I change the message that display on the status bar when the mouse
    is passed over a link button or an image button on a web form? Any Ideas
    would be appreciated. Thanks in advance.

    Steve

  2. #2
    Phil Weber Guest

    Re: Change message on Status Bar

    > How can I change the message that display on the status
    > bar when the mouse is passed over a link button or an image
    > button on a Web Form?


    Steve: Add the following attribute to the desired controls:

    onmouseover="javascript:window.status='Your message here'"

    --
    Phil Weber



  3. #3
    Steve Guest

    Re: Change message on Status Bar


    Thanks for the prompt reply. For your info, I'm using server control for my
    web form. I'm new to HTML and not very sure where should I include the attribute
    in the controls. Following are part of my HTML code:

    <TD align="middle" width="50" bgColor="#429ac3" height="18" id="tdStandardMenu"
    vAlign="center" colSpan="1" rowSpan="1"><asp:LinkButton id="lbtnHome" runat="server">Home</asp:LinkButton></TD>

    Please advice.
    Steve

    "Phil Weber" <pweber@nospam.fawcette.com> wrote:
    > > How can I change the message that display on the status
    > > bar when the mouse is passed over a link button or an image
    > > button on a Web Form?

    >
    >Steve: Add the following attribute to the desired controls:
    >
    > onmouseover="javascript:window.status='Your message here'"
    >
    >--
    >Phil Weber
    >
    >



  4. #4
    Russell Jones Guest

    Re: Change message on Status Bar

    Steve:

    Although you can add attributes manually by editing your Web form in HTML
    view, you're better off (IMO) getting a reference to the control in code and
    adding attributes that way. Use the Page.FindControl method to get a
    reference to a control. To add an attribute to a control, get a reference to
    the control and then use its Attributes collection's Add method to add a key
    (the attribute name) and a value (the attribute value). For example, in your
    Page_Load method, you could write:

    Dim lbtn As LinkButton = Me.FindControl("lbtnHome")
    If Not lbtn Is Nothing Then
    lbtn.Attributes.Add("onmouseover", "javascript:window.status='Your
    message here'")
    End If

    Note that doing this programmatically lets you do things such as store the
    status strings in resource files and apply them at runtime, so you could
    easily add multi-language capability to your Web Forms, or change messages
    based on application conditions, user preferences, or whatever you need.

    "Steve" <vb.@127.0.0.1> wrote in message news:3da8ea97$1@10.1.10.29...
    >
    > Thanks for the prompt reply. For your info, I'm using server control for

    my
    > web form. I'm new to HTML and not very sure where should I include the

    attribute
    > in the controls. Following are part of my HTML code:
    >
    > <TD align="middle" width="50" bgColor="#429ac3" height="18"

    id="tdStandardMenu"
    > vAlign="center" colSpan="1" rowSpan="1"><asp:LinkButton id="lbtnHome"

    runat="server">Home</asp:LinkButton></TD>
    >
    > Please advice.
    > Steve
    >
    > "Phil Weber" <pweber@nospam.fawcette.com> wrote:
    > > > How can I change the message that display on the status
    > > > bar when the mouse is passed over a link button or an image
    > > > button on a Web Form?

    > >
    > >Steve: Add the following attribute to the desired controls:
    > >
    > > onmouseover="javascript:window.status='Your message here'"
    > >
    > >--
    > >Phil Weber
    > >
    > >

    >




  5. #5
    Steve Guest

    Re: Change message on Status Bar


    Thank you everybody. I had added two attributes to the control and it is working
    now. Here are some of the code in the Page_Load method:

    Dim lbtn As LinkButton = Me.FindControl("lbtnHome")
    If Not lbtn Is Nothing Then
    lbtn.Attributes.Add("onMouseOver", "javascript:window.status='Your message
    here';return true")
    lbtn.Attributes.Add("onMouseOut", "javascript:window.status=''")
    End If

    Will explore further and thanks again.

    "Russell Jones" <arj1@nospam.northstate.net> wrote:
    >Steve:
    >
    >Although you can add attributes manually by editing your Web form in HTML
    >view, you're better off (IMO) getting a reference to the control in code

    and
    >adding attributes that way. Use the Page.FindControl method to get a
    >reference to a control. To add an attribute to a control, get a reference

    to
    >the control and then use its Attributes collection's Add method to add a

    key
    >(the attribute name) and a value (the attribute value). For example, in

    your
    >Page_Load method, you could write:
    >
    >Dim lbtn As LinkButton = Me.FindControl("lbtnHome")
    >If Not lbtn Is Nothing Then
    > lbtn.Attributes.Add("onmouseover", "javascript:window.status='Your
    >message here'")
    >End If
    >
    >Note that doing this programmatically lets you do things such as store the
    >status strings in resource files and apply them at runtime, so you could
    >easily add multi-language capability to your Web Forms, or change messages
    >based on application conditions, user preferences, or whatever you need.
    >
    >"Steve" <vb.@127.0.0.1> wrote in message news:3da8ea97$1@10.1.10.29...
    >>
    >> Thanks for the prompt reply. For your info, I'm using server control for

    >my
    >> web form. I'm new to HTML and not very sure where should I include the

    >attribute
    >> in the controls. Following are part of my HTML code:
    >>
    >> <TD align="middle" width="50" bgColor="#429ac3" height="18"

    >id="tdStandardMenu"
    >> vAlign="center" colSpan="1" rowSpan="1"><asp:LinkButton id="lbtnHome"

    >runat="server">Home</asp:LinkButton></TD>
    >>
    >> Please advice.
    >> Steve
    >>
    >> "Phil Weber" <pweber@nospam.fawcette.com> wrote:
    >> > > How can I change the message that display on the status
    >> > > bar when the mouse is passed over a link button or an image
    >> > > button on a Web Form?
    >> >
    >> >Steve: Add the following attribute to the desired controls:
    >> >
    >> > onmouseover="javascript:window.status='Your message here'"
    >> >
    >> >--
    >> >Phil Weber
    >> >
    >> >

    >>

    >
    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center