Please take a look at the following tutorial:
http://code.daypilot.org/59860/asp-net-mvc-5-event-calendar
It shows how to use the Calendar control in MVC. It uses the Pro version but the same approach works for the Lite version.
In short, you need to use TimeRangeSelectedHandling and TimeRangeSelectedJavaScript properties to handle event creating:
MVC View
@Html.DayPilotCalendar("dp", new DayPilotCalendarConfig
{
BackendUrl = Url.Action("Backend", "Calendar"),
ViewType = ViewType.Week,
TimeRangeSelectedHandling = TimeRangeSelectedHandlingType.JavaScript,
TimeRangeSelectedJavaScript = "create(start, end)"
})
JavaScript - create() method
<script type="text/javascript">
function create(start, end) {
var m = new DayPilot.Modal();
m.closed = function () {
if (this.result == "OK") {
dp.commandCallBack('refresh');
}
dp.clearSelection();
};
m.showUrl('@Url.Action("Create", "Event")?start=' + start + '&end=' + end);
}
</script>
See also:
http://doc.daypilot.org/calendar/event-creating/