Click here to Skip to main content
16,015,583 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hii i am implementing button mouse hover but i am facing an issue
here i am declare button like the below.

VB
<asp:Button ID="Button14" runat="server" Text="Single Company Analysis" CssClass="button"
                   OnClick="btnsinglecomapny_Click"  CommandArgument="Single" BackColor="#0082AA" ForeColor="#ffffff"   />


and mouse hover declared like this

CSS
#Button14:hover
 {
     background-color:Red;
 }


i tried to declare the backcolor by default using css and.cs

when i am remove the back color from the .aspx in button the hover is working other wise it's not working.
how to declare button backcolor by default.

please share any idea to me
Posted
Comments
Sergey Alexandrovich Kryukov 25-Mar-14 3:24am    
Tried? How?
—SA
nandakishoreroyal 25-Mar-14 3:25am    
assign backcolor onmouseout event using jquery

If you are calling JavaScript function on button click the you need to write:

OnClientClick="btnsinglecomapny_Click()"
 
Share this answer
 
I don't understand what was the problem to guess what to do. It could be something like:
CSS
#Button14 { background-color:Yellow; }
#Button14:hover { background-color:Red; }
Am I missing anything? :-)

—SA
 
Share this answer
 
hello
use your back color in your css file,and then you can set the hover too :

CSS
.button
{
  background-color:#0082AA;
}

.button:hover
{
  background-color:Red;
}
 
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