DataList\FormatDate

G

gh

Below is the code from an aspx file for the datalist

<ItemTemplate>
<p>Company:&nbsp;
<asp:Label id="UserFieldLabel" runat="server" width="450px"
text='<%# Eval("UserField") %>'></asp:Label>&nbsp;Project:
<asp:Label id="PrjNameLabel" runat="server" width="253px"
text='<%# Eval("PrjName") %>'></asp:Label>&nbsp;Project Date:
<asp:Label id="ProjectDateLabel" runat="server" text='<%#
Eval("ProjectDate") %>'></asp:Label>Address:


Where do I put the format code to have project date display as
mm/dd/yyyy? Is {d: mm/dd/yyyy} the correct code for this?

TIA
 
T

Teemu Keiski

Hi,

you can use format string with Eval

<asp:Label id="ProjectDateLabel" runat="server" text='<%#
Eval("ProjectDate","{0:mm/dd/yyyy}") %>'>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top