Groups | Blog | Home
all groups > asp.net > december 2003 >

asp.net : Repeater class


Natty Gur
12/31/2003 9:29:47 PM
Hi,

You have to use string similar to those used by String.Format :
d - shourt date format.
D - long date format.
<%# DataBinder.Eval(Container.DataItem, "Date", "{0:d}") %>


Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377


*** Sent via Developersdex http://www.developersdex.com ***
Calvin Lai
12/31/2003 11:15:52 PM
Hi all,

I have a repeater control trying to display some info including date
information to the client. I used the following:
<%# DataBinder.Eval(Container.DataItem, "Date", "DataTime.Parse({0},
oCulture)") %>
but it doesn't work as intended. (The oCulture is a culture info object).I
also tried:
<%# DateTime.Parse(DataBinder.Eval(Container.DataItem, "Date", "{0}"),
oCulture) %>;
However, it also gives me runtime compilation error.

Anyone has idea how to do this? I believe this shd be simple. Thanks for
all contributions.

Calvin

Calvin Lai
1/1/2004 4:47:50 PM
Hi,

Thanks for the solution. However, what if I want to display it accroding to
a specific culture? For the DateTime display, I could display it as
DataTime.Parse(dateString,oCulture)
In this case, how would I be able to do that? Thanks.


[quoted text, click to view]

AddThis Social Bookmark Button