PC Review


Reply
Thread Tools Rate Thread

DataList\FormatDate

 
 
gh
Guest
Posts: n/a
 
      1st Oct 2007
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
 
Reply With Quote
 
 
 
 
Teemu Keiski
Guest
Posts: n/a
 
      2nd Oct 2007
Hi,

you can use format string with Eval

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


--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net


"gh" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FormatDate =?Utf-8?B?TWF0dA==?= Microsoft Access Queries 1 15th Nov 2006 09:54 AM
setting SelectedIndex of DataList nested inside of DataList? Les Caudle Microsoft ASP .NET 0 2nd May 2006 11:44 PM
Setting up a datalist control - Item_DataBound for a datalist in a datalist Nevyn Twyll Microsoft ASP .NET 8 9th Sep 2004 11:13 PM
Click event in a datalist to post back datalist properties Steve Lloyd Microsoft ASP .NET 1 26th May 2004 05:07 AM
FormatDate jb Microsoft Excel Programming 1 3rd Sep 2003 09:03 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:52 AM.