我正在想办法改变日期时间格式,这样就可以显示日期了.
<asp:Repeater ID="RepeaterActions" runat="server">
<ItemTemplate>
<li>
<span class="historyDate"><%#DataBinder.Eval(Container.DataItem, "ActionListDate")%></span>
<span class="historyName"><%#DataBinder.Eval(Container.DataItem, "LeadActionName")%></span><br />
<span class="historyNotes"><%#DataBinder.Eval(Container.DataItem, "ActionListNote")%></span>
</li>
</ItemTemplate>
</asp:Repeater>
I'm guessing it's something in between the <% %>, but I'm not sure.
我的代码是:
<pre>
protected void RepeaterActionsFill()
{
string sql = @" select a.ActionListDate, a.LeadListID,
a.ActionListNote,
l.LeadActionName
from ActionLists as a
INNER JOIN LeadActions as l
ON a.LeadActionID = l.LeadActionID
where a.LeadListID = " + Convert.ToInt32(Request["id"].ToString());
RepeaterActions.DataSource = DBUtil.FillDataReader(sql);
RepeaterActions.DataBind();
}
</pre>
目前,它看起来是这样的:
我要找的是时间戳消失在那里.
感谢您的帮助.
编辑:
以下是我想要的:
<asp:Repeater ID="RepeaterActions" runat="server">
<ItemTemplate>
<li>
<span class="historyDate"><%#DataBinder.Eval(Container.DataItem, "ActionListDate", "{0:M/d/yy}")%></span>
<span class="historyName"><%#DataBinder.Eval(Container.DataItem, "LeadActionName")%></span><br />
<span class="historyNotes"><%#DataBinder.Eval(Container.DataItem, "ActionListNote")%></span>
</li>
</ItemTemplate>
</asp:Repeater>