I have a button on my asp.net page that (upon mouseover) needs to act like a hyperlink (the hand cursor). I cannot use a linkbutton because I need the GUI of a regular asp:button.
Is there a way to create the hyperlink cursor on mouseover?
Thanks
Using css you can say:
.anchor {cursor: pointer; cursor: hand;}
and then in your aspx:
<asp:Button CssClass="anchor" ... >
Use the following for the hand cursor on button mouse over:
<asp:Button ID="Button1" runat="server" Text="Click Me" CssClass="ButtonClass" />
The in a style sheet or inline in the page itself define the class:
.ButtonClass
{
cursor: pointer; cursor: hand;
}
Use both (pointer and hand) for cross browser compatibility.
Add this into your button's markup...
style="cursor: pointer; cursor: hand;"
so...
<asp:Button id="test" text="test" runat="server" style="cursor: pointer; cursor: hand;" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With