Format a Date from a DataBinder.Eval

J

jack

Hello,

I have a date in a SQL Database and want to use the dateformat tools to
format the output. I am now using the Month, Day, and Year to do it now.

I want to change:

Released Date: <%#Month(DataBinder.Eval(Container.DataItem, "ProdDate"))
& "/" & Day(DataBinder.Eval(Container.DataItem, "ProdDate")) & "/" &
Year(DataBinder.Eval(Container.DataItem, "ProdDate")) %><BR><BR>


To:

Released Date: <%#DataBinder.Eval(Container.DataItem,
"ProdDate").ToString("d")%><BR><BR>

But I get an error.

Any help would be great!!!

Thanks for you time and help,

Jack
 
S

S. Justin Gengo

Jack,

I haven't tested this code but it will look something like this:

<%#String.Format("d", DataBinder.Eval(Container.DataItem,
"ProdDate").ToString)%>

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 

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

Top