我想从绑定到网格视图标签的Date对象中获取星期几,如下所示:
<asp:Label ID="ResourceAvailabilityDayLabel" runat="server" Text='<%# Bind("Date", "{0:d}") %>'></asp:Label>{0:d}如果日期是2012年11月4日,它将发布11,则仅以数字显示日期。是否有方法在绑定期间执行此操作?我找不到正确的DateStringFormat。
编辑
{0:dddd}解决了此问题。
发布于 2012-04-11 22:43:18
要获取星期几,请使用ddd或dddd format specifier
<asp:Label ID="ResourceAvailabilityDayLabel" runat="server" Text='<%# Bind("Date", "{0:dddd}") %>'></asp:Label>https://stackoverflow.com/questions/10108172
复制相似问题