.NET button font color change on mouseover

Is there any way to get a .NET (2003) web form asp button control to change font color on mouseover?

If not, I need a control that can do a rollover and still cause a submit and run a code behind click method on post-back.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ralf KlattEmployee in Civil ServiceCommented:

I think this here is a very good example on how to build the desired function ... its about a calender control ... but generally very comprehensive ...

"Easily Adding Functionality to ASP.NET Server Controls - By Scott Mitchell"

Best regards, Raisor
Hi Raisor
Do the following :-

Create to style classes in your style sheet (or between Style tags on the html view of the page) one called btnOver - which is how you want the button to look when the mouse is over, the other called BtnOut

Now add you button to the page and set the cssclass property to BtnOut

then flip to the HTML view of the page from the page design view (bottom left of page)
find the button and add the following to line html
onmouseover="javascript:this.className='BtnOver'"  onmouseout="javascript:this.className='BtnOut'"

You whole line should now look a bit like

<asp:button id="CmdFinances" onmouseover="javascript:this.className='BtnOver'" style="Z-INDEX: 106; LEFT: 626px; POSITION: absolute; TOP: 11px" tabindex="101" onmouseout="javascript:this.className='BtnOut'" height="24px" text="Finances" cssclass="btn" width="112px" runat="server"></asp:button>


No run your project and it should change as the mouse goes over.

Hope this helps


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Fonts Typography

From novice to tech pro — start learning today.