title: Cannot set DateTime with input field. Always returns DateTime.MinValue
body: <p>My program is supposed to have a date filter and gives an article with proper date. But when I input any date in my DateTime field, my values don't change and are always DateTime.MinValue. I don't know why and how I can fix it. </p>
  
  <p>View: </p>
  
  <pre><code>    &lt;form method="get"&gt;
      &lt;div class="form-inline form-group"&gt;
          &lt;label class="control-label"&gt; since: &lt;/label&gt;
          @Html.TextBox("startdate", Model.StartDate, htmlAttributes: new { @class = "form-control" })
          &lt;label class="control-label"&gt; till: &lt;/label&gt;
          @Html.TextBox("enddate", Model.EndDate, htmlAttributes: new { @class = "form-control" })
  
  
          &lt;input type="submit" value="Filtr" class="btn btn-default" /&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Model:</p>
  
  <pre><code> public class MainView
  {
      public IEnumerable&lt;Article&gt; Articles { get; set; }
      public string Name { get; set; }
      public SelectList Categories { get; set; }
      public DateTime StartDate { get; set; }
      public DateTime EndDate { get; set; }
      public List&lt;int&gt; Tags { get; set; }
  }
  </code></pre>
  
  <p>And Controller:</p>
  
  <pre><code> public  IActionResult Index(int? category, string name, DateTime startdateTime, DateTime enddateTime)
        {
  
  
          IQueryable&lt;Article&gt; articles = db.Articles.Include(p =&gt; p.Category);
             if (category != null &amp;&amp; category != 0)
             {
                 articles = articles.Where(p =&gt; p.CategoryId == category);
             }
  
             if (!String.IsNullOrEmpty(name))
             {
                 articles = articles.Where(p =&gt; p.Name.Contains(name));
             }
  
  
             //if (startdateTime == null) startdateTime = DateTime.MinValue;
             if (enddateTime ==DateTime.MinValue) enddateTime = DateTime.Now;
              articles = articles.Where(p =&gt; p.Date&gt;=startdateTime &amp;&amp; p.Date &lt;= enddateTime);               
  
           List&lt;Category&gt; categories = db.Categories.OrderBy(p=&gt;p.Name).ToList();
             categories.Insert(0, new Category { Name = "All", Id = 0 });
  
          MainView viewModel = new MainView
          {
  
              Name = name,
              StartDate = startdateTime,
              EndDate = enddateTime
  
          };
             return View(viewModel);
        }
  </code></pre>