我正在尝试实现一个calander,它将显示已经完成的预订,并且位于数据库中的一个表中。
遵循本教程之后:https://www.codeproject.com/Articles/404647/AJAX-Event-Calendar-Scheduler-for-ASP-NET-MVC-3-in
我有一个空白,日历应该在那里,它似乎要离开一个很大的区域,所以我不知道它是在哪里出错,或者它是否没有渲染它或什么的。我没有错误,也看不出我哪里出了错。
以下是我对诽谤的看法:
@{
ViewBag.Title = "Booking Calander";
}
<h2>All Bookings</h2>
<div id="dp">
<script src="@Url.Content("~/Scripts/DayPilot/daypilot-all.min.js")" type="text/javascript"></script>
@Html.DayPilotCalendar("dpc", new DayPilotCalendarConfig
{
BackendUrl = Url.Content("~/Home/BookingCalander"),
})
</div>下面是我在控制器中的内容(只是在家庭控制器中):
public ActionResult BookingCalander()
{
return View();
}
public ActionResult Backend()
{
return new Dpc().CallBack(this);
}
public class Dpc : DayPilotCalendar
{
protected override void OnInit(InitArgs e)
{
var db = new ApplicationDbContext();
Events = from ev in db.HallBookings select ev;
DataIdField = "ActivityBookingId";
DataTextField = "Activity" + " - " + "CustomerName";
DataStartField = "BookingStartTime";
DataEndField = "BookingEndTime";
Update();
}
}我已经将命名空间添加到视图/Web.Config:
<namespaces>
<add namespace="DayPilot.Web.Mvc"/>
</namespaces>
</pages>
</system.web.webPages.razor>发布于 2017-05-15 18:24:20
BackendUrl应该指向“后端”操作(顾名思义):
@Html.DayPilotCalendar("dpc", new DayPilotCalendarConfig
{
BackendUrl = Url.Content("~/Home/Backend"),
})https://stackoverflow.com/questions/43986257
复制相似问题