Includes a trial version of DayPilot Pro for JavaScript (see also License below)

DayPilot Pro has a special edition for ASP.NET WebForms. The ASP.NET WebForms edition makes the event calendar available as a traditional ASP.NET control which handles the client-server communication transparently.

However, if you want more control over the client-side behavior you can use the pure client-side solution - DayPilot Pro for JavaScript. The JavaScript version doesn't include any server-side part and it communicates with the server using custom JSON endpoints that you need to create.

There are many ways to implement JSON endpoints in ASP.NET (WebMethods, WebAPI, WCF...). This tutorial uses a fallback solution that overrides a Web Forms page response and serializes the data manually using Json.NET library.

License

Licensed for testing and evaluation purposes. Please see the license agreement included in the sample project. You can use the source code of the tutorial if you are a licensed user of DayPilot Pro for JavaScript. Buy a license.

Json.NET Library

We will use Json.NET library for JSON serialization and deserialization. Add Newtonsoft.Json package to the Visual Studio project dependencies using NuGet console:

POST Endpoint for Creating New Calendar Events

We can use this approach for all other JSON endpoints as well. As the next step, we will add a handler for onTimeRangeSelected event handler which is fired when the user selects a time range. The event handler opens a modal dialog and ask the user to enter new event details. When the event details are confirmed it calls JsonCreateEvent.aspx endpoint using DayPilot.Http.ajax() method to save the new event in the database.