Solved

.NET button font color change on mouseover

Posted on 2003-11-29
2
2,274 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
[X]
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
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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Magento: different theme for Pc and for mobile devices 4 118
Numbers in fonts funny displayed... 11 49
auto play video on web page 4 58
calculate days away 11 61
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

734 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