The commandCallBack() method can be used to send custom command with custom data to the server side.

Typical Use

  • Reload the event data
  • Switch the visible time range
  • Refresh the control after changing the resources
  • Filtering the visible events

How It Works

When you invoke the commandCallBack() function on the client-side DayPilot Calendar object, it will fire the Command event handler on the server-side using an AJAX call.

In the Command event handler you should call Update() after doing your work and reloading the events using DataBind().

See also: Update() method


  • command (string) - custom command type string
  • data (any JavaScript object) - custom data that will be sent to the server-side Command handler

The data parameter will be translated into JsonData class - see also Sending custom data with CallBack.


ASP.NET WebForms

Example (switching to a specified year)


<a href="javascript:dpm.commandCallBack('year', 2013);">Next</a>


protected void DayPilotMonth1_Command(object sender, CommandEventArgs e)
  switch (e.Command)
      case "year":
          DayPilotCalendar1.StartDate = new DateTime((int)e.Data, 1, 1);
      // ...
  // ...