I am doing a demo application for learning the use of new HTML5 input types (example- Date, email etc as TextMode) introduced in asp.net textbox control.
In my sample page I want to display server side date field data using asp:TextBox with TextMode="Date".
The asp.net code goes as:
<asp:TextBox ID="txtExpenseDate" TextMode="Date" runat="server"></asp:TextBox>
The C# backend code goes as
protected void Page_Load(object sender, EventArgs e)
{
txtExpenseDate.Text = DateTime.Now.ToString("MM/dd/yyyy");
}
But while the page loads, the date value does not get displayed in the textbox.
What am I doing wrong?
addendum: Just realized that since this is HTML5, I must mention browser version. I am on latest Google Chrome Version 33.0.1750.117 m. This displays the field as a calendar to pick the date, thus supports the HTML5 equivalant of TextMode="Date" attribute .
Regards,
Sumit