代码
1 <tr style='background-color: <%#(Container.ItemIndex%2==0)?"#eeeeee":"#ffffff"%>'onmouseover="this.style.background='#ddeeff'" onmouseout="this.style.background='<%#(Container.ItemIndex%2==0)?"#eeeeee":"#ffffff"%>'">
最终效果:当鼠标移过数据表的记录行时,指针所指的行的背景色改变,以达到跟其他行区分的效果。
做法:在Repeater中的Itemtemplate下的<tr>中加入如上代码,即可实现!