Formatting a date obtained using databinding

  • Thread starter Thread starter Nathan Sokalski
  • Start date Start date
N

Nathan Sokalski

I have a field in a dataset (which I filled using an Oracle database) that
contains a date. I want to format the date to look like the
ToLongDateString() method. The current code that I have in my label control
which will be displaying the date is as follows:

text='<%# DataBinder.Eval(Container,"DataItem.events.eventdate") %>'

I know that there is a way to use a third parameter to format the output,
but I am not sure what this should look like. If someone could please help
me here, I would appreciate it. Thanks.
 
AFAIK the third parameter is not good for dates. Format it in the code in
either ItemDataBound or PreRender event,

Eliyahu
 

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

Back
Top