代码
<script type="text/javascript">
function fOver(obj){
c=obj.style.backgroundColor;
obj.style.backgroundColor="#CAD3E4";
}
function fOut(obj){
obj.style.backgroundColor=c;
}
</script>
<table>
<tr>
<td>用户编号</td>
</tr>
<asp:Repeater ID="rptUser" runat="server">
<ItemTemplate>
<tr style='background-color:<%#(Container.ItemIndex%2==0)?"red":"green"%>' onmouseover="fOver(this);" onmouseout="fOut(this);">
<td><%#Eval("UID")%></td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>
function fOver(obj){
c=obj.style.backgroundColor;
obj.style.backgroundColor="#CAD3E4";
}
function fOut(obj){
obj.style.backgroundColor=c;
}
</script>
<table>
<tr>
<td>用户编号</td>
</tr>
<asp:Repeater ID="rptUser" runat="server">
<ItemTemplate>
<tr style='background-color:<%#(Container.ItemIndex%2==0)?"red":"green"%>' onmouseover="fOver(this);" onmouseout="fOut(this);">
<td><%#Eval("UID")%></td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>