【发布时间】:2022-11-17 18:46:26
【问题描述】:
在模型中:
public DateTime? FromDate { get;set; }
在视图中:
<div class="form-group">
<label class="label other">
From Date
</label>
<div class="col-md-10">
@Html.EditorFor(model => model.FromDate, new { htmlAttributes = new { @class = "form-control", type = "Date", min = "1944-01-01", max = "2019-01-01" } })
@Html.ValidationMessageFor(model => model.FromDate, "", new { @class = "text-danger" })
</div>
</div>
当我们从 DateTime 选择器日历中输入日期时,它会输入日期:
在Index 视图中它还显示了时间:
问题是我不想在索引视图中显示时间和日期。
【问题讨论】:
标签: c# asp.net-mvc razor