473,416 Members | 1,531 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,416 software developers and data experts.

how do i display a date field using databind.eval ?

Hi

How do i display a date field using databind.eval ?
Nov 19 '05 #1
3 6093
There's a 3rd parameters to eval which is the format, so normally you have:

DataBinder.Eval(Container.DataItem, "DateField")
but you can do:
DataBinder.Eval(Container.DataItem, "DateField", "someFormat")

try:

DataBinder.Eval(Container.DataItem, "DateField", "{0:d}")

and check out:
http://msdn.microsoft.com/library/de...ngOverview.asp
Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
"natin" <na*****@write-image.co.uk> wrote in message
news:55**************************@posting.google.c om...
Hi

How do i display a date field using databind.eval ?

Nov 19 '05 #2
d is for decimal. There is no format for date in this parameter. You can do
it in code behind in ItemDataBound or PreRender event. Alternatively you can
provide a page property in code behind that will do the formatting and
databind to this property.

Eliyahu

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:Op*************@TK2MSFTNGP12.phx.gbl...
There's a 3rd parameters to eval which is the format, so normally you have:
DataBinder.Eval(Container.DataItem, "DateField")
but you can do:
DataBinder.Eval(Container.DataItem, "DateField", "someFormat")

try:

DataBinder.Eval(Container.DataItem, "DateField", "{0:d}")

and check out:
http://msdn.microsoft.com/library/de...ngOverview.asp

Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
"natin" <na*****@write-image.co.uk> wrote in message
news:55**************************@posting.google.c om...
Hi

How do i display a date field using databind.eval ?


Nov 19 '05 #3
Hi

Thanks for the reply.
You are correct, and it is working now.

:)

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #4

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

Similar topics

4
by: karunakar | last post by:
Hi All I was poplating Datagrid Datagrid has one of the column showing datetime field format iam showing DATE here not Necessary to populate the Time Frame Even my datebase column also...
5
by: bg | last post by:
Hi! How do I check if "date" exists before using that code? I've built a RSSreader and sometimes there's a date in it and sometimes not. How can I check if it exists to avoid crash...
4
by: dtblankenship | last post by:
Hello everyone, I know this question has been asked many times in the forums, and after spending a few days reading, I am still confused as to the answer. I have a ListBox (lstBox),...
4
by: Patrick.O.Ige | last post by:
I'm DataBinding a CheckBoxList and i want to get the checkboxes selected when the page is loaded depending on a Boolean value from the Database.. chkDebtor.DataSource = objDR...
5
by: somequestion | last post by:
< uc1:BoardWrite ID="BoardWrite1" CommentId="<%# Eval("CommentId") %>" runat="server" /> this is visual studio 2005 asp.net tag. first it's nor working..but i need this because i will use this...
1
by: Vear | last post by:
I have a gridview inside a content placeholder that has the first column as a hyperlink. I changed it from a Hyperlinkfield to a Template field so I could name the hyperlink control. I can't figure...
5
by: Howard | last post by:
I have a databind in a repeater control <%#Eval("Score")%> Score is a float float Score = 3.2; However the html output is always 3 I cannot make it display 3.2. PLease help, Howard
4
by: Jim Florence | last post by:
Hello, I've just started in ASP and I'm having a few teething problems. Initially I tried to write out dates from the database using <asp:Label runat="server" ID="Label6" Text='<%#...
3
by: shapper | last post by:
Hello, In my GridView I have a HyperLink Field where I set the DataNavigateUrlFormaString MyHyperLinkField.DataNavigateUrlFormatString = "~\RSS.ashx?Channel={0}&Culture=" &...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.