I assume you are using the browser's date picker not a jQuery date picker. The first thing you should do is read the documentation to learn how the date type works.
Your HTML is invalid it is missing the type="date", it missing the date format, and it not clear what ValidForm is.
<input class="form-control" value="@(Model?.ValidFrom)" name="ValidFrom">
The HTML helper is using the wrong date format. The date format should be yyyy-MM-dd as illustrated in the linked documentation.
Example
Model
public class DateModel
{
public DateTime? MyDate { get; set; }
}
```
Controller
```csharp
public class DateExController : Controller
{
// GET: DateEx
public ActionResult Index()
{
DateModel myModel = new DateModel() { MyDate = DateTime.Now };
return View(myModel);
}
}
View
@model MvcDemo2.Models.DateModel
@{
ViewBag.Title = "Index";
}
<h2>Index</h2>
<div>
<input type="date" value="@Model?.MyDate.ToString("yyyy-MM-dd")" name="MyDate" />
</div>
<div>
@Html.TextBoxFor(t => t.MyDate, "{0:yyyy-MM-dd}", new { type = "date" })
</div>
To test null
public ActionResult Index()
{
DateModel myModel = new DateModel(); //{ MyDate = DateTime.Now };
return View(myModel);
}