Formview Question about Dates and Formatting

D

David Hearn

I have a formview control in my project (VS2005/ASP.NET 2.0) and I have one
field that is a date. I have it formatting correctly as a short date
(MM/dd/yyyy) but when I click the edit link to edit the record, it is
showing the long date/time format. How do I force the thing to only show
short date format while in edit mode also?

Thanks in advance!
 
O

Onwuka Emeka

You might want to format the date in the EditTemplate as well if you are
using Bind it should be <%#Bind("PropertyName","{0:MM/dd/yyyy}")%> or with
Eval <%#Eval("PropertyName","{0:MM/dd/yyyy}")%>
 
D

David Hearn

That worked! Thanks!


Onwuka Emeka said:
You might want to format the date in the EditTemplate as well if you are
using Bind it should be <%#Bind("PropertyName","{0:MM/dd/yyyy}")%> or with
Eval <%#Eval("PropertyName","{0:MM/dd/yyyy}")%>
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top