Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Sep 16, 2006 10:59 AM by geedubb
Sep 14, 2006 01:24 PM|LINK
I have a simple XML doc with an XSD. It has a single root node, with several child nodes all with attributes of 'Name' (String), 'Text' (String) and Date (DateTime).
I'm using an XmlDataProvider which references my XML file. The XmlDataProvider is then bound to a DataList. The bind works, and I can see my data presented as desired in the DataList at runtime. My problem is that I wish to format the Date so that it is
displayed yyyy-mm-dd. I have specifying the DataFormatString for the 'date' boundcolumn, but have had no luck in getting this to work. What is the easiest way to do this? My dates are properly encoded in the xml file in ISO standard yyyy-mm-ddThh:mm:ss.mmm
Any help greatly appreciated.
Sep 14, 2006 10:05 PM|LINK
You could use XmlConvert to convert to a DateTime, something like this
Text='<%# System.Xml.XmlConvert.ToDateTime(XPath("@date").ToString()).ToShortDateString() %>'></asp:Label>
Sep 16, 2006 10:59 AM|LINK