Repeater隔行变色简易实现
<
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 >
< 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 >