Format is the second parameter of Eval
. The following should get you there:
<asp:Label ID="lblTransactionDate" runat="server"
Text='<%# Eval("transactionDate", "{0:MM/dd/yyyy}") %>'></asp:Label>
Notice that I changed the format string from mm/DD/yyyy
to MM/dd/yyyy
.
MM
- Month
mm
- Minute
DD
- Not valid
dd
- Day
Edit:
I assume your transactionDate
may be a string. In that case, use the following:
<asp:Label ID="lblTransactionDate" runat="server"
Text='<%# String.Format("{0:MM/dd/yyyy}",DateTime.Parse(Eval("transactionDate").ToString())) %>'></asp:Label>
Above I have converted the string
to a DateTime
so that it can utilize the format.