陋室铭
永远也不要停下学习的脚步(大道至简至易)

<table>
<tr>
<td>用户编号</td>
</tr>
<asp:Repeater ID="rptUser" runat="server">
<ItemTemplate>
<tr style='background-color:<%#(Container.ItemIndex%2==0)?"red":"green"%>'>
<td><%#Eval("UID")%></td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>

改变样式的话

                                <asp:Repeater ID="Repeater1" runat="server" OnItemDataBound="Repeater1_ItemDataBound">
<ItemTemplate>
<tr class='<%#(Container.ItemIndex%2==0)?"RowStyle":"AlternatingRowStyle"%>' onmouseover="currentcolor=this.style.backgroundColor;this.style.backgroundColor='#6dbcfd',this.style.fontWeight='';"
onmouseout="this.style.backgroundColor=currentcolor,this.style.fontWeight='';">

 


 

 

posted on 2012-03-15 13:54  宏宇  阅读(481)  评论(0编辑  收藏  举报