मैं डेटाटाइम प्रारूप को बदलने का तरीका जानने का प्रयास कर रहा हूं, इसलिए बस तारीख दिखाई देगी।मैं asp.net में DataBinder.Eval का दिनांक प्रारूप कैसे बदलूं?
<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>
मैं इसे अनुमान लगा रहा हूँ <%%> के बीच में कुछ है, लेकिन मैं यकीन नहीं है।
मेरे कोड के पीछे है:
<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>
यह तब से काम नहीं करता है। ToString() कोई पैरामीटर नहीं ले सकता .. – banging