Click here to Skip to main content
15,893,161 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to use a linkbutton for a webpage, but it doesn't have a mouseover and mouseout event. I want to use those to change the style of the linkbutton. How can i do this? Please give me an example!
Thanks!
----------------------------------------------------------------------
how to change its backgroundimage when occur a mouse event.
Posted
Updated 8-Nov-10 14:30pm
v3

I found this in a forum. Hope this will help
Css should be like this:
CSS
a.SelectedItem:link,
a.SelectedItem:visited {
      color:#ffffff;
   }
a.SelectedItem:hover {
      color:#999999;
   }
a.SelectedItem:active {
      color:#ffffff;
   }


And in your ASPX your link button should be like this:
<asp:LinkButton CssClass ="SelectedItem" .... runat="server">Click Me!</LinkButton>


Please note if you just use a:link, a:visited, a:hover, a:active, the styles will be applied to all links in the page automatically.
 
Share this answer
 
Comments
AngelLoose 8-Nov-10 1:01am    
thanks!It's work
See here[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900