【发布时间】:2014-01-30 02:09:44
【问题描述】:
我正在制作一个 MVC5 网站,正如您已经知道的那样。现在我刚刚使用具有 BirthDate 字段的 Crete 模板创建了一个视图。 Andit 没有在 IE 中显示,在 Chrome 中显示很糟糕,文本框内有很多字形,如下图所示。
发生了什么,如何让 IE 像 Chrome 一样简单地显示日期选择器,以及如何稍微清理一下。我认为那些杠杆毫无用处且令人困惑。
这是我在模型中定义该属性的方式
[Display(Name = "Fecha de nacimiento")]
[DataType(DataType.Date)]
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:MM/dd/yyyy}")]
public DateTime BirthDate { get; set; }
在视图中
<div class="form-group">
@Html.LabelFor(model => model.BirthDate, new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.BirthDate)
@Html.ValidationMessageFor(model => model.BirthDate)
</div>
</div>
【问题讨论】:
标签: asp.net-mvc internet-explorer datepicker