Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

.NET button font color change on mouseover

Posted on 2003-11-29
2
2,272 Views
Last Modified: 2013-12-03
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.
0
Comment
Question by:nicholas_1969
2 Comments
 
LVL 15

Expert Comment

by:Raisor
ID: 9846365
Hi,

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"
http://aspnet.4guysfromrolla.com/articles/100103-1.aspx

Best regards, Raisor
0
 
LVL 5

Accepted Solution

by:
CaptainRantflaps earned 250 total points
ID: 9971521
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>

DONT WORRY ABOUT THE RED WAVY UNDERLINES - IT WILL STILL COMPLIE AND WORK.

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

Hope this helps

Simon.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question