|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Is there a way to set onmouseover for a LinkButton in ASP.NET 2.0 ?Is there a way within ASP.NET 2.0 to set the onmouseover property of a
LinkButton so that when the user hovers over the LinkButton, the windows status bar displays some text instead of the javascript command ? I'd like to do something like: <asp:LinkButton ID="LinkEdit" Runat="server" CommandName="Edit"> onMouseOver="LinkButton_onMouseOver ('Click here to Edit the Record')" onMouseOut="LinkButton_onMouseOut" </asp:LinkButton> function LinkButton_onMouseOver (strStatus) { window.status=strStatus; return true; } function LinkButton_onMouseOut () { window.status=""; return true; } I do not believe there is a built-in way to do this in ASP.NET, but a common
workaround is to use the Attributes collection. Use onMouseOver or onMouseOut as the Key, and use the script you want to be run as the Value. For example: LinkEdit.Attributes.Add("onMouseOut","window.status=''; return true;") If you would prefer to use functions define the functions inside script tags in the .aspx file and do the following: LinkEdit.Attributes.Add("onMouseOut","LinkButton_onMouseOut();") Good Luck! Show quoteHide quote "Roberto Kohler" <rkoh***@intranetslab.com> wrote in message news:emnph4yCGHA.4068@TK2MSFTNGP14.phx.gbl... > Is there a way within ASP.NET 2.0 to set the onmouseover property of a > LinkButton so that when the user hovers over the LinkButton, the windows > status bar displays some text instead of the javascript command ? > > I'd like to do something like: > <asp:LinkButton ID="LinkEdit" Runat="server" CommandName="Edit"> > onMouseOver="LinkButton_onMouseOver ('Click here to Edit the Record')" > onMouseOut="LinkButton_onMouseOut" > </asp:LinkButton> > > function LinkButton_onMouseOver (strStatus) > { window.status=strStatus; return true; } > > function LinkButton_onMouseOut () > { window.status=""; return true; } >
Master Pages and Cross-Page Form Information
Wizard Control and IsPostBack extended Label webcontrol, doesn't populate it's children ?? Adding Access keys to menu items in the Menu control GridView: Update is just not working for me Repeater Grouping file upload control - ASP2.0 Adding DataMember support to SqlDataSource Earn money Online - without risk! Any solution for text wrap in DropDownList control? |
|||||||||||||||||||||||