feesu
asked on
ASP.NET - Formating Date/Time from codebehind
Hi Experts,
I need to display formatted date/time from codebehind, I am doing the following but it doesn't show the proper time:
lblValueDate.Text = Format(CType(DV.Table.Rows (0).Item(" ValueDate" ).ToString , DateTime), "hh:mm tt, dd - MMMM - yyyy")
Although, similar code works fine when assigned from the markup to a grid on the same page:
<asp:Label ID="lblValueDate" runat="server" CssClass="note"
text='<%# "Posted " & Format(DataBinder.Eval(Con tainer, "DataItem.ValueDate"),"hh: mm, dd - MMMM - yyyy") %>'></asp:Label>
</td>
I need to display formatted date/time from codebehind, I am doing the following but it doesn't show the proper time:
lblValueDate.Text = Format(CType(DV.Table.Rows
Although, similar code works fine when assigned from the markup to a grid on the same page:
<asp:Label ID="lblValueDate" runat="server" CssClass="note"
text='<%# "Posted " & Format(DataBinder.Eval(Con
</td>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.