views:

7

answers:

1

Hi All,

I have a DataboundField in a grid. I'm trying to display a date in Euro format and the time. The time should be wrapped in a span with a css class applied to it.

I am using this, DataFormatString="{0:dd/MM/yyyy <\span cla\s\s='tinyDate'>hh:mm:ss</\span>}"

It's actually pretty close, except the span tag is literally rendering in the browser.

In the cell the text looks like this

19/10/2010 <span class=tinyDate>09:35:00</span>

I don't intend to see the span tag, only it's formatted content. How can I remedy this and make it render correctly?

Thanks for any tips or links.

Cheers,
~ck in San Diego

+2  A: 

Try setting the HtmlEncode property of the field to "false". It's enabled by default to prevent any malicious client-script code from being executed.

Tim S. Van Haren
Perfect! Thanks Tim. That worked. This is a read only grid, so it should be ok. Terrific!
Hcabnettek