Image rollover question(Hyperlink)
It seems to work by doing this in the ItemCreated
Public Sub Repeater_ItemCreated(ByVal sender As Object, ByVal e As RepeaterItemEventArgs)
If e.Item.ItemType = ListItemType.Item OrElse e.Item.ItemType = ListItemType.AlternatingItem Then
Dim hyperLink As HyperLink = CType(e.Item.FindControl("HyperLink1"), HyperLink)
Dim Image As System.Web.UI.WebControls.Image = CType(e.Item.FindControl("Image1"), System.Web.UI.WebControls.Image)
hyperLink.Attributes.Add("onMouseOver", "document.getElementById('" & Image.ClientID & "').src='images/up.gif';return true;")
hyperLink.Attributes.Add("onMouseOut", "document.getElementById('" & Image.ClientID & "').src='images/off.gif'; return true;")
End If
End Sub
But wen i Mouse over the first hyperlink its good and it behaves well but the second doesn't
When i put my mouseover the second link the images for the first link appear so it seems when i mouse over the second link images appear and dissapear for the first link.
Any idea how to fix this?
Thanks alot
When i viewed the source code i have this below:-
<tr width="150px" style="cursor:hand" onmouseover="style.backgroundColor='#c0c0c0';"
onmouseout="style.backgroundColor=''" bordercolor="#000000">
<td>
<img id="Links__ctl1_Image1" name="Image1" src="images/off.gif" alt="" border="0" />
<a id="Links__ctl1_HyperLink1" class="a" onMouseOver="document.getElementById('Image1').src='images/up.gif';return true;" onMouseOut="document.getElementById('Image1').src='images/off.gif'; return true;" href="ShowRatings.aspx?CategoryID=1">test</a>
</td>
</tr>
<tr width="150px" style="cursor:hand" onmouseover="style.backgroundColor='#c0c0c0';"
onmouseout="style.backgroundColor=''" bordercolor="#000000">
<td>
<img id="Links__ctl2_Image1" name="Image1" src="images/off.gif" alt="" border="0" />
<a id="Links__ctl2_HyperLink1" class="a" onMouseOver="document.getElementById('Image1').src='images/up.gif';return true;" onMouseOut="document.getElementById('Image1').src='images/off.gif'; return true;" href="ShowRatings.aspx?CategoryID=2">test2</a>
</td>
</tr>

