Chasing Tail, PLEASE HELP

D

David Lozzi

Howdy,

Happy 2007!!

Here's my issue and it seems so simple, but it escapes me. I'm using asp.net
2.0 and a gridview. There is one column which is a date. In SQL this field
is a smalldatetime and only has a date specified, i.e. 1/2/2007. When it
displays on the page, it is adding 12:00:00 AM. I can't for the life of my
format this stupid thing. I tried using the DataFormatString but didn't know
the syntax so I tried using a TemplateField with a label and something like
<%# FormatDateTime(Bind("dtDate"),"mm/dd/yyyy") %> but then it errors
stating Bind is not declared.

<cowering in corner shaking /> please help

Thanks,

David Lozzi
 
M

Mark Rae

I tried using the DataFormatString but didn't know the syntax

Google is your friend...

But here you go anyway...

<asp:BoundField DataField="..." DataFormatString="{0:ddd dd MMM yyyy}"
HtmlEncode="false" ... />
 
D

David Lozzi

DUH, thats what i was missing, the HtmlEncode property.....................

Thank you!!

David Lozzi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top