Hi I'm trying to format a datetime field to just show the date. The datetime is bound to an asp:label and for the Text attribute I have tried the following....
Text= String.Format("{0:D}", '<%# Bind("CReviewDate") %>')
and
Text= String.Format("{0:D}", <%# Bind("CReviewDate") %>)
and
Text= String.Format("{0:D}", <%# Bind('CReviewDate') %>)
and
Text= String.Format("{0:D}", <%# Bind(CReviewDate) %>)
In all cases I get a green wavy line under the equation and the tip help says "Validation (ASP.Net): If this attribute value is enclosed in quotation marks, the quotation marks must match.
String.Format("{0:D}", DateTime.Now)
is the syntax that I have been told should work.
What have I done wrong....
I've not failed! Just found 100 (well 4) ways that don't work...yet!