【发布时间】:2012-07-17 23:45:19
【问题描述】:
DatePicker 围绕项目工作,但不能在模式中工作。 Modal 是一个局部视图。
这在编辑器模板中。
日期时间.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>
【问题讨论】:
-
您可以尝试将自定义类添加到您的文本框并将脚本添加到实际的局部视图而不是编辑器模板上吗?您现在需要使用类而不是 id 调用 jquery 函数
-
@pollirrata 谢谢朋友,你能帮我写代码吗?
标签: c# asp.net-mvc-3 jquery-ui-datepicker