我什至无法获得基本的日历弹出窗口。这是我拥有的脚本和代码:
Note: I am using jquery 1.10.2 and it is included first.
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
"~/Scripts/bootstrap.js",
"~/Scripts/bootstrap-datepicker.js",
"~/Scripts/respond.js"));
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/bootstrap.css",
"~/Content/bootstrap-datepicker3.css",
"~/Content/site.css",
"~/Content/override.css"));
<div class="input-group date">
@Html.TextBox("ForesterDate", today, new { @class = "form-control datepicker" })
<span class="input-group-addon"><i class="glyphicon glyphicon-th"></i></span>
</div>
在页面底部的脚本标签中:
$(document).ready(function () {
$('.datepicker').datepicker();
});
文本框的样式看起来正确,但是单击效果不好。我以为这可能是一个剃须刀问题,所以我用html制作了一个文本框,没有任何变化:
<input type="text" class="form-control datepicker" />
问题出在我有脚本标签的地方。这是我的第一个MVC5应用程序,我想您不能再将其固定在视图的底部,它必须位于@section()中,该部分在_include的底部呈现。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句