DayPilot Knowledge Base

AJAX Calendar/Scheduling Controls
DayPilot Pro (AJAX Calendar Control)
» DayPilot ASP.NET Calendar
DayPilot Pro (AJAX Monthly Calendar Control)
» DayPilot ASP.NET Monthly Calendar
DayPilot Pro (AJAX Scheduler Control)
» DayPilot ASP.NET Scheduler
DayPilot » Knowledge Base » How to show a confirmation dialog before deleting an event (Calendar)

How to show a confirmation dialog before deleting an event (Calendar)

Last revision: May 28, 2012

calendar delete event confirmation

In order to show a confirmation dialog box before deleting an Calendar event using the delete [x] icon (the upper-right event corner) you need to switch to JavaScript EventDelete handling:

<daypilot:daypilotcalendar id="DayPilotCalendar1" runat="server" 
  OnEventDelete="DayPilotCalendar1_EventDelete" 
  EventDeleteHandling="JavaScript" 
  EventDeleteJavaScript="if (confirm('Do you really want to delete ' + e.text() + ' ?')) dpc1.eventDeleteCallBack(e);" 
  ...
</daypilot:daypilotcalendar>

The JavaScript handler (EventDeleteJavaScript) will show a default browser confirmation dialog box. If the user confirms the action by clicking "OK" it will fire EventDelete event on the server side (using CallBack).

Related

How to open a new event dialog using TimeRangeSelected event (modal.js)
How to show event details in a modal dialog (modal.js)
How to show a calendar event Bubble using JavaScript
How to show the selected date using a Label control