}

如果ModifyDate==“12“ DateTime.Now.Date也等于12
return Color.Red
如当日不是12号是13号
ModifyDate+1=DateTime.Now.Date
相当于12+1=13
return Color.Orange;
否则
return Color.Black;
.aspx的Label绑定
<asp:Label id=lblDate runat="server" ForeColor='<%# GetTitleForColor(DataBinder.Eval(Container, "DataItem.ModifyDate").ToString()) %>' Text='<%# "[" + DataBinder.Eval(Container, "DataItem.ModifyDate","{0:M-d}") + "]" %>'></asp:Label>

相关文章:

  • 2021-06-11
  • 2022-03-01
  • 2021-08-20
  • 2021-08-09
  • 2021-06-08
  • 2021-11-01
  • 2021-05-15
猜你喜欢
  • 2021-11-19
  • 2021-12-15
  • 2021-12-11
  • 2021-11-18
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案