title: Set value to input type="date" from codebehind
body: <p>I want to assign value to my HTML tag <code>input type="date"</code> 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: <br/></p>
  
  <p><a href="https://i.stack.imgur.com/g78G4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/g78G4.png" alt="enter image description here"></a></p>
  
  <p><strong>ASPX:</strong></p>
  
  <pre><code>&lt;input type="date" runat="server" id="date_datumPrispetja" value="dd. MM. yyyy" /&gt;
  </code></pre>
  
  <p><strong>Codebehind:</strong></p>
  
  <pre><code>string date = myDate.ToString("dd. MM. yyyy"); //value of date: "09. 04. 2017";
  date_datumPrispetja.Value = date;
  </code></pre>
  
  <p>Is this is even possible, to assign value from codebehind to this HTML5 element?</p>
  
  <hr>
  
  <p><strong><em>EDIT:</em></strong></p>
  
  <p>Compare on <code>datetime</code> and <code>date</code> input type.
  <strong>C#:</strong></p>
  
  <pre><code>date_datumPrispetja.Value = DateTime.Now.ToString("dd. MM. yyyy");
  hi.Value = DateTime.Now.ToString("dd. MM. yyyy");
  </code></pre>
  
  <p><strong>ASPX:</strong></p>
  
  <pre><code>&lt;input type="date"  runat="server" id="date_datumPrispetja" value="dd. MM. yyyy"/&gt;
  &lt;br /&gt;
  &lt;input type="datetime" runat="server" id="hi" value="dd. MM. yyyy" /&gt;
  </code></pre>
  
  <p><strong>RESULT:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/doi1q.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/doi1q.png" alt="enter image description here"></a></p>