The request must start with 'JSON' string.
8 years ago.
I working on a web application written in ASP.NET MVC 5 with Razor.
When i publish website in IIS it throws the error "The request must start with JSON string".
Someone who can help me?
My View:
@Html.DayPilotScheduler("dp", new DayPilotSchedulerConfig
{
//BackendUrl = Url.Action("Backend", "Scheduler"),
BackendUrl = @Url.Action("Backend", "Scheduler"),
//Url.Content("~/Scheduler/Backend"),
StartDate = new DateTime(DateTime.Today.Year, 1, 1),
Days = 365,
Scale = TimeScale.Day,
CellGroupBy = GroupBy.Month,
CellDuration = 1440,
TimeRangeSelectedHandling = TimeRangeSelectedHandlingType.JavaScript,
TimeRangeSelectedJavaScript = "create(start, end, resource);",
TimeRangeSelectingJavaScript = "selecting(args)",
EventClickHandling = EventClickHandlingType.JavaScript,
EventDeleteHandling = EventDeleteHandlingType.CallBack,
EventMoveHandling = EventMoveHandlingType.CallBack,
...
})
Controller:
[HandleError]
public class SchedulerController : Controller
{
BDCalendarEntities dc = new BDCalendarEntities();
public ActionResult Backend()
{
return new Scheduler().CallBack(this); <-- THE PROBLEM
}
class Scheduler : DayPilotScheduler
{
BDCalendarEntities dc = new BDCalendarEntities();
protected override void OnInit(InitArgs e)
{
Timeline = new TimeCellCollection();
LoadEmployeesAndHolidays();
ScrollTo(DateTime.Today.AddDays(-1));
Separators.Add(DateTime.Now, Color.Red);
}
...
DayPilot