如何增加新闻NEW图片
aspx程序代码:
<asp:Repeater ID="Repeater2" runat="server"> <ItemTemplate> <table cellpadding="3" cellspacing="0" border="0"> <tr height="25"> <td style="word-break: break-all;" width="500" align="left"> <div style="margin-left: 10px"> <%#Eval("Title")%></div> </td> <td width="175" align="left"> <%#Eval("DateTime")%> </td> </tr> </table> </ItemTemplate> </asp:Repeater>cs
string sql = "select top 5 * from New order by DateTime desc"; DataTable table = SqlHelper.ExecuteDataTable(CommandType.Text, sql); Repeater2.DataSource = table; Repeater2.DataBind();取前5条记录,前2条记录的后面加个NEW图片,不知道如何实现?