Date formatstring in a gridview

  • Thread starter Richard Carpenter
  • Start date
R

Richard Carpenter

I have a simple gridview control contained in a panel in a web user
control. One of the columns in the gridview is of type SQLDateTime. I
would like to strip off the time portion of the DateTime values. I
tried editing the column and specifying a DataFormatString value of
{0:d}, but it just seems to be ignored.

Can someone please tell me what I may be missing here?

Thanks.
Rich
 
R

Richard Carpenter

ReyN said:
hello Richard

you have to add

htmlencode=false

in the column definition

Thank you! That was proving to be a difficult little bugger to track
down. Now I'm off to figure out exactly what exactly the htmlencode
controls. :)

Thanks again!
Rich
 
R

Richard Carpenter

PeterKellner said:

Peter,

That was extremely helpful information - just what I was looking for.
Can you comment on just what kind of danger there might be in
"cross-site scripting attacks and malicious content display" when the
grid is processed on the ASP.Net server? My understanding was that a
mere HTML table is generated and sent to the client in either case.
Where is the opportunity for malicious code to be introduced?

Thanks!
Rich
 

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,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top