Anyname Donotcare
Anyname Donotcare

Reputation: 11393

How to format Session datetime value in aspx?

How to format Session datetime value in aspx itself to get the date part only.


<asp:Label ID="Label1" runat="server" Text='<%#Session["start_date_lect"]%>'></asp:Label>

Upvotes: 0

Views: 175

Answers (1)

Ravi
Ravi

Reputation: 320

Please modify your code like this:

<asp:Label ID="Label1" runat="server" Text='<%#string.Format("{0:MM/dd/yyyy}",Session["start_date_lect"])%>'></asp:Label>

Upvotes: 1

Related Questions