Changing forecolor of LinkButton with a mouseover event

Using ASP.NET 2.0 how do you change a LinkButton's forecolor when the mouse is hovered over it?  I have seen references to CSS (Cascading Style Sheets), but I am not comfortable with them at this time.

When the mouse passes over the LinkButton I want the font to be bold then return to normal when the LinkButton loses focus.
Ray TurnerSenior ConsultantAsked:
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.

digitalZoCommented:
Add this on your Page_Load:

LinkButton1.Attributes.Add("onmouseover", "window.status='';this.style.fontWeight='bold'; return true")
0
digitalZoCommented:
Sorry add these two lines on your Page_Load:

LinkButton1.Attributes.Add("onmouseover", "window.status='';this.style.fontWeight='bold'; return true")
LinkButton1.Attributes.Add("onmouseout", "window.status='';this.style.fontWeight='normal'; return true")
0
digitalZoCommented:
Personally, I think CSS is more convenient and easier to use.
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Pratima PharandeCommented:
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
       <style type="text/CSS">
a {color:violet}
a:hover{color:green}
</style>
</head>
<body>
    <form id="form1"   runat="server" >
    <div>
     
        <asp:LinkButton ID="LinkButton1"  runat="server" >LinkButton</asp:LinkButton>
    </div>
    </form>
</body>
</html>


codebehind

 LinkButton1.Attributes.Add("class","myA");

refer

http://www.thescripts.com/forum/thread286900.html
0
Ray TurnerSenior ConsultantAuthor Commented:
How would change the font color and font weight together?
0
Pratima PharandeCommented:
you can hange it in style

    <style type="text/CSS">
a {color:violet}
a:hover{color:green}
</style>
0
digitalZoCommented:
Just add this: this.style.color='colorname'

LinkButton1.Attributes.Add("onmouseover", "window.status='';this.style.fontWeight='bold'; this.style.color='#00ff00'; return true")
LinkButton1.Attributes.Add("onmouseout", "window.status='';this.style.fontWeight='normal';this.style.color='blue'; return true")
0

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
ASP.NET

From novice to tech pro — start learning today.