asp.net datalist 根据时间 显示图片
2个回答
展开全部
<asp:DataList ID="dstProducts" runat="server">
<ItemTemplate>
<%# Convert.ToDateTime ( Eval ( "CreateDate" ) ).Subtract ( DateTime.Today ).Days == 0 ? "<img src=\"https://gss0.bdstatic.com/70cFsjip0QIZ8tyhnq/img/logo-zhidao.gif\" alt=\"baidu\" />" : "" %>
</ItemTemplate>
</asp:DataList>
<ItemTemplate>
<%# Convert.ToDateTime ( Eval ( "CreateDate" ) ).Subtract ( DateTime.Today ).Days == 0 ? "<img src=\"https://gss0.bdstatic.com/70cFsjip0QIZ8tyhnq/img/logo-zhidao.gif\" alt=\"baidu\" />" : "" %>
</ItemTemplate>
</asp:DataList>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询