DayPilot Pro for ASP.NET MVC requires that the backend endpoint URL is specified using backendUrl property.

Note: Standalone usage (without backendUrl) requires a DayPilot Pro for JavaScript license (see below).

MVC Helper (Razor)

@Html.DayPilotScheduler("dps_areas", new DayPilotSchedulerConfig {
  BackendUrl = Url.Action("Backend", "Scheduler"),
  // ...
})

Plain JavaScript

<div id="dp"></div>

<script>
  var dp = new DayPilot.Scheduler("dp");
  dp.backendUrl = '@Url.Action("Backend", "Scheduler")';
  // ...
  dp.init();
</script>

jQuery Plugin

<div id="dp"></div>

<script>
  var dp = $("#dp").daypilotScheduler({
    backendUrl: '@Url.Action("Backend", "Scheduler")',
    // ...
  });
</script>

Backend Controller

The target URL needs to point to a controller action that handles the request using a custom instance of DayPilotScheduler, DayPilotCalendar, DayPilotMonth, DayPilotGantt class:

using System.Web.Mvc;
// ...

namespace MvcApplication1.Controllers
{
    public class SchedulerController : Controller
    {
        // ...
        public ActionResult Backend()
        {
            return new Dps().CallBack(this);
        }

        class Dps : DayPilotScheduler
        {
            protected override void OnInit(InitArgs ea)
            {
              // ...
            }
        }
    }
}

Licensing Restrictions

Please note that using the JavaScript files (e.g. daypilot-all.min.js) from DayPilot Pro for ASP.NET MVC in a standalone mode (without the integrated backend endpoint specified using backendUrl) requires a DayPilot Pro for JavaScript license. The standalone usage of the JavaScript files has been limited by the license since the introduction of DayPilot Pro for JavaScript in 2013. See also the license agreement for details.