DatePicker 在项目周围工作,但不能在模式中工作。模态是部分视图。
这在编辑器模板中。
日期时间.cshtml
@model System.DateTime?
@Html.TextBox("", ViewData.TemplateInfo.FormattedModelValue, new { @class = "editor-field" })
<script type="text/javascript">
if (typeof (jQuery) == 'function') {
$(function () {
if ($.datepicker) {
$('#@this.ViewData.TemplateInfo.GetFullHtmlFieldId("")')
.datepicker();
}
});
}
</script>