Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / October 2007

Tip: Looking for answers? Try searching our database.

DataList\FormatDate

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
gh - 01 Oct 2007 02:21 GMT
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
Teemu Keiski - 02 Oct 2007 17:13 GMT
Hi,

you can use format string with Eval

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

Signature

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

> Below is the code from an aspx file for the datalist
>
[quoted text clipped - 11 lines]
>
> TIA

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.