ASP.NET MVC HtmlHelper扩展之Calendar日期时间选择
(1)时间控件:My97DatePicker
<script src="WdatePicker/WdatePicker.js"></script>
@Html.TextBoxFor(model => model.LESSONLEARNDATE, new { htmlAttributes = new { @sytle = "width:180px;" }, Value = String.Format("{0:yyyy-MM-dd}", Model.LESSONLEARNDATE) , @class = "wdate", onfocus = "WdatePicker()" })
(2)Bug1 - Asp.Net MVC Html.TextBoxFor日期格式化
解决办法:
@Html.TextBoxFor(model => model.OpenTime, new { Value = String.Format("{0:yyyy-MM-dd}", Model.InNewspaperTime) })
或者@Html.TextBoxFor(model => model.OpenTime, new { Value =Model.InNewspaperTime.ToString() })
注意:此例对 @Html.EditorFor 无效