Question Formatting Bound Data

Mych

New member
Joined
Mar 23, 2010
Messages
1
Programming Experience
10+
Hi I'm new to vb.net and I'm trying to format a datetime field to just show the date. The datetime is bound to an asp:label and I have tried the following in the Text attribute....

VB.NET:
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.

VB.NET:
Text='<%# Bind("CReviewDate") %>'
works fine but shows both date and time.
What have I done wrong....:confused:

I've not failed! Just found 100 ways that don't work...yet!
 
Last edited:
Back
Top