Say you want to format a DateTime in a grid or other databound control. You're given a DataFormatString attribute on the Field or Column control, so you'd think that'd be it right? Nope.
Don't forget to add HtmlEncode="false" or you'll be looking at the same long DateTime string and scratching your head as to why. This keeps getting me, so I thought I'd blog it.
In Code:
this.HtmlEncode = false;
this.DataFormatString = "{0:MM/dd/yy}"