我想在我看来有一个日期时间选择器。 这就是我所做的
@{
ViewBag.Title = "CreateAppointment_SetDate";
Layout = "~/Views/Shared/_Layout.cshtml";
@Styles.Render("~/Content/Kendo/css")
}
@Html.HiddenFor(m=>m.AppointmentId)
<h3>When should appointment take place?</h3>
<h4>Please select the date range for the appointment to take place between</h4>
<h6>Please select a start date</h6>
<div class="col-md-10">
@(Html.Kendo().DateTimePicker().Name("dateTimePicker").Value(DateTime.Now))
</div>
@Scripts.Render("~/Scripts/Kendo/jquery.min.js")
@Scripts.Render("~/bundles/Kendo")
和捆绑
bundles.Add(new StyleBundle("~/Content/Kendo/css").Include(
"~/Content/kendo/kendo.common.min.css",
"~/Content/kendo/kendo.default.min.css",
"~/Content/kendo/kendo.bootstrap.min.css"));
bundles.Add(new ScriptBundle("~/bundles/Kendo").Include(
"~/Scripts/Kendo/kendo.all.min.js",
"~/Scripts/Kendo/kendo.aspnetmvc.min.js"));
这就是我所看到的,没有选择日期和时间的图标。
知道我该怎么做才能让它发挥作用吗?
答案 0 :(得分:3)
您的网页中存在JavaScript错误,因为使用datepicker后会包含JavaScript文件。你可以:
在使用datepicker
之前移动@ Scripts.Render@Scripts.Render("~/Scripts/Kendo/jquery.min.js")
@Scripts.Render("~/bundles/Kendo")
<div class="col-md-10">
@(Html.Kendo().DateTimePicker().Name("dateTimePicker")
.Value(DateTime.Now))
</div>