ASP Image BorderColor Change on mouseover

I'm writing a .NET website using c#.  I am making a photo gallery and have the images within asp:Image components.  Here is the code for the components:
<asp:Image ID="thumbnail01" runat="server" BorderColor="Green" BorderWidth="2px" />

On mouseover, I want the image border color to change.  I tried this with no luck:
thumbnail01.Attributes.Add("onmouseover", "document.getElementById(thumbnail01').BorderColor='Red'");

I also tried this with no luck:
thumbnail01.Attributes.Add("onmouseover", "document.getElementById('thumbnail01').style.BorderColor='Red'");

And this:
thumbnail01.Attributes.Add("onmouseover", "this.BorderColor='Red'");

I also tried doing it through a stylesheet with no luck  What am I missing here?  Is there a special way to reference a BorderColor in an asp:Image?  
Who is Participating?
David H.H.LeeCommented:
Hi borderColor,
Almost there, javascript is case-sensitive.
    thumbnail01.Attributes.Add("onmouseover", "'Red';");

Pratima PharandeCommented:
try this

  thumbnail01.Attributes.Add("onmouseover", "document.getElementById('thumbnail01').style.borderColor='Red'");

Javascript is Case Sensative
so change BorderColor  to  borderColor as shown above
David H.H.LeeCommented:
Ooopps, too late after enter the comment...
Instead try using JQuery

This way you can make it reusable and much more intuitive - easy to implement.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.