mouseover effect

B

Bart

I want to create a mouseover effect which colors the row when the
mousepointer goes over a row. I use this code in the itemDataBound event

If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType =
ListItemType.AlternatingItem Then
e.Item.Attributes.Add("onMouseOver",
"this.style.backgroundColor='Silver'")
e.Item.Attributes.Add("onmouseout",
"this.style.backgroundColor='white'")
e.Item.Style("cursor") = "hand"
End If

The code works fine. But when I attach a stylesheet (css) to the page, the
mouseover won't work anymore. It seems that the stylesheet 'overrules' all
other attributes. Any idea how to solve this ?

Bart
 
R

R. Thomas, aka Xtreme.Net

Hi bart all my pages have stylesheets attached to it, but my color change
still works. Style sheet does not cause any problems. Maybe you are
overlooking something else?
HTHs...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top