I want to assign value to my HTML tag input type="date"
from C# codebehind in ASP.NET web application. After page is loaded, the value is not visible, but in chrome dev tools i can see the value:
ASPX:
<input type="date" runat="server" id="date_datumPrispetja" value="dd. MM. yyyy" />
Codebehind:
string date = myDate.ToString("dd. MM. yyyy"); //value of date: "09. 04. 2017";
date_datumPrispetja.Value = date;
Is this is even possible, to assign value from codebehind to this HTML5 element?
EDIT:
Compare on datetime
and date
input type.
C#:
date_datumPrispetja.Value = DateTime.Now.ToString("dd. MM. yyyy");
hi.Value = DateTime.Now.ToString("dd. MM. yyyy");
ASPX:
<input type="date" runat="server" id="date_datumPrispetja" value="dd. MM. yyyy"/>
<br />
<input type="datetime" runat="server" id="hi" value="dd. MM. yyyy" />
RESULT: