473,406 Members | 2,451 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Format Dates using Repeater Control

Hello -

I am pulling a datetime var from a dataset which is binded to a repeater
control as follows:

<%# DataBinder.Eval(Container.DataItem, "DateCreated") %>

The datetime value returns fine, but is not formated. How can i format this
"inline code"? I am aware that this can be done using code-behind,
specifically using the ItemDataBound event, but i'd like to learn how i can
format dates, if possible, right in the above linem using the DataBinder
method.

Thanks,
Nov 19 '05 #1
1 1835
Try this:

<%# System.Convert.ToDateTime (DataBinder.Eval(Container.DataItem,
"DateCreated")) .ToString ("MM-dd-yyyy") %>

Eliyahu

"charliewest" <ch*********@discussions.microsoft.com> wrote in message
news:A9**********************************@microsof t.com...
Hello -

I am pulling a datetime var from a dataset which is binded to a repeater
control as follows:

<%# DataBinder.Eval(Container.DataItem, "DateCreated") %>

The datetime value returns fine, but is not formated. How can i format this "inline code"? I am aware that this can be done using code-behind,
specifically using the ItemDataBound event, but i'd like to learn how i can format dates, if possible, right in the above linem using the DataBinder
method.

Thanks,

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Chumley the Walrus | last post by:
I'm trying to display a date from my sql database, but when I use a repeater control as follows: <ASP:Repeater id="thedata" runat="server"> <itemtemplate> <%# Container.DataItem("ArticleDate")%>...
1
by: Laurence Neville | last post by:
This is regarding a change in the Short Date format under Hebrew Regional Settings, that has caused huge problems in our ASP web application. The change appears to have been introduced sometime...
2
by: Ray | last post by:
I am entering dates in to form using the dd/mm/yy format, however I am using a SQL which involves searching for those dates. I have formatted the dates in the SQL ot the US format of mm/dd/yy as...
1
by: Peter | last post by:
Does anyone have an example of how to format VS 2003 Data Grid that looks like the example below? I want the data to be grouped by the Date Field and display one date for each group of dates and...
2
by: John Holmes | last post by:
I am using radioButton controls in a data repeater and would like to incorporate the 'key' field into the 'id' attribute of the radioButton controls and name them something like: 'rad' + '<%#...
2
by: Sun | last post by:
Hi, I display date in asp.net pages using user defined format: mydate.text=Format(dr("MyDate"), "MMM. d, yyyy"). It works fine for all pages except one. In that page, I built a dataAdapter,...
2
by: Nobody | last post by:
Ok, I've got my page laid out pretty much how I want it, but can't figure out one part... my "content" area is a fixed width table with 2 columns... COL A = 600px wide & COL B = 170px wide... ...
16
by: Mik | last post by:
I apologise if this post seems a little basic, but I am a newbie and have NO access knowledge. I have downloaded the Accounts Ledger from the Microsoft Website. It allows the user to review a...
1
by: jazzart | last post by:
Hi there, I'm fairly new to programming with Asp.Net 2.0 so I'm finding myself regularly fumbling around in the dark a bit, so to speak. I'm currently using Visual Web Developer and have been...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.