我在ASP .NET MVC 5.1中编写应用程序
我有一个领域:
[DisplayName("Date of Birth")]
[DataType(DataType.Date)]
public DateTime BirthDate { get; set; }
Run Code Online (Sandbox Code Playgroud)
然后在视图中
<div class="form-group">
@Html.LabelFor(model => model.BirthDate, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.BirthDate, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.BirthDate, "", new { @class = "text-danger" })
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
转换为:

如果我只是将模型中的属性上面的注释更改为:
[DisplayName("Date of Birth")]
[DataType(DataType.DateTime)]
Run Code Online (Sandbox Code Playgroud)
我没有显示任何选择器.如果我将它们改为:
[DisplayName("Date of Birth")]
[DataType(DataType.Time)]
Run Code Online (Sandbox Code Playgroud)
只有hh:mm可供选择.
问题:在ASP .NET MVC 5.1中显示DateTime选择器而不是日期选择器.我要求ASP .NET 5.1 HTML 5特定的解决方案.