Click here to Skip to main content
15,891,828 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How do you trigger asp:ImageButton hover so that you can change code behind
eg. when i hover over the button i would like the image url to change
Posted
Updated 27-Sep-11 6:10am
v2
Comments
Wonde Tadesse 27-Sep-11 11:49am    
Please elaborate more about " change code behind " ?

1 solution

In this case I recommend you to use Asp.Net LinkButton plus a CSS. Here is an example
ASP.NET
<asp:LinkButton ID="LinkButton1" runat="server CssClass="LinkButton">

Here is the CSS
CSS
.LinkButton
{
  background:url("imagePath/imageFile.gif") top left no-repeat;
  display:block; 
  width:32px;  
  height: 32px;  
}

.LinkButton:hover
{
  background:url("imagePath/mouseOverImageFile.gif") top left no-repeat;
  display:block; 
  width:32px;  
  height: 32px; 
}
 
Share this answer
 
v3
Comments
Avineshin 28-Sep-11 2:23am    
Thanks but i was wondering if there is a way to do this without style sheets

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