GridView日期列使用DataFormatString格式化技巧

mac2022-06-30  66

GridView日期列使用DataFormatString="{0:d}",没有任何变化?依然显示“2006-3-30 0:00:00”

 <asp:BoundField DataField="SignedDate" HeaderText="签订日期" DataFormatString="{0:d}" >

没有变化 应该加上

HtmlEncode="false" ,DataFormatString的设置才会生效。

 <asp:BoundField DataField="SignedDate" HeaderText="签订日期" DataFormatString="{0:d}" HtmlEncode="false"/>

转载于:https://www.cnblogs.com/liyejun/archive/2009/03/24/1420854.html

相关资源:ASP.NET GridView控件在列上格式化时间及DataFormatString使用
最新回复(0)