Back to Devexpress

SchedulerSettings.CallbackRouteValues Property

aspnetmvc-devexpress-dot-web-dot-mvc-dot-schedulersettings.md

latest7.3 KB
Original Source

SchedulerSettings.CallbackRouteValues Property

Defines the callback routing logic by specifying the names of a Controller and an Action which should handle callbacks.

Namespace : DevExpress.Web.Mvc

Assembly : DevExpress.Web.Mvc5.v25.2.dll

NuGet Package : DevExpress.Web.Mvc5

Declaration

csharp
public object CallbackRouteValues { get; set; }
vb
Public Property CallbackRouteValues As Object

Property Value

TypeDescription
Object

An object containing the Controller and Action names.

|

Remarks

The CallbackRouteValues property allows you to pass only simple data (that do not require serialization) to the controller. If you need to send complex data, use one of the following approaches.

  1. Use the CallbackRouteValues collection to pass only the information that is required to recreate your complex model instance in the controller action (e.g., row keys or unique identifiers).
  2. Convert your complex model class into a simple data type. For instance, use the JSON encoding to pass the model to the controller as a string. Then, in the controller code, decode the passed value to get the model.
cshtml
@Html.DevExpress().Scheduler(settings => {  
    settings.Name = "Scheduler";  
    ...  
    settings.CallbackRouteValues = new {  
        Controller = "Home",  
        Action = "IndexPartial",  
        myComplexData = Json.Encode(Model.myListData)  
    };  
}).GetHtml()
csharp
public ActionResult IndexPartial(string SelectedIds) {  
    List<int> myData = System.Web.Helpers.Json.Decode<List<int>>(myComplexData);  
    ...  
}

The following code snippets (auto-collected from DevExpress Examples) contain references to the CallbackRouteValues property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

asp-net-mvc-scheduler-fetch-appointment-event/CS/DevExpressMvcSchedulerFetchAppointments/Models/SchedulerSettingsHelper.cs#L23

csharp
settings.Name = "scheduler";
settings.CallbackRouteValues = new { Controller = "Home", Action = "SchedulerPartial" };
settings.EditAppointmentRouteValues = new { Controller = "Home", Action = "EditAppointment" };

how-to-customize-the-appointment-dialog-using-view-model-api-working-with-custom-fields-t582020/CS/DevExpressMvcApplication1/Models/SchedulerDataHelper.cs#L106

csharp
settings.Name = "scheduler";
settings.CallbackRouteValues = new { Controller = "Home", Action = "SchedulerPartial" };
settings.EditAppointmentRouteValues = new { Controller = "Home", Action = "EditAppointment" };

asp-net-mvc-scheduler-use-checkboxlist-to-filter-resources/CS/Code/SchedulerHelper.cs#L21

csharp
settings.Name = "scheduler";
settings.CallbackRouteValues = new { Controller = "Home", Action = "SchedulerPartial" };
settings.EditAppointmentRouteValues = new { Controller = "Home", Action = "EditAppointment" };

asp-net-mvc-scheduler-appointment-edit-form/CS/Code/SchedulerHelper.cs#L22

csharp
settings.Name = "scheduler";
settings.CallbackRouteValues = new { Controller = "Home", Action = "SchedulerPartial" };
settings.EditAppointmentRouteValues = new { Controller = "Home", Action = "EditAppointment" };

asp-net-mvc-scheduler-fetch-appointment-event/VB/DevExpressMvcSchedulerFetchAppointments/Models/SchedulerSettingsHelper.vb#L21

vb
settings.Name = "scheduler"
settings.CallbackRouteValues = New With {Key .Controller = "Home", Key .Action = "SchedulerPartial"}
settings.EditAppointmentRouteValues = New With {Key .Controller = "Home", Key .Action = "EditAppointment"}

how-to-customize-the-appointment-dialog-using-view-model-api-working-with-custom-fields-t582020/VB/DevExpressMvcApplication1/Models/SchedulerDataHelper.vb#L111

vb
settings.Name = "scheduler"
settings.CallbackRouteValues = New With {Key .Controller = "Home", Key .Action = "SchedulerPartial"}
settings.EditAppointmentRouteValues = New With {Key .Controller = "Home", Key .Action = "EditAppointment"}

asp-net-mvc-scheduler-use-checkboxlist-to-filter-resources/VB/Code/SchedulerHelper.vb#L26

vb
settings.Name = "scheduler"
settings.CallbackRouteValues = New With {Key .Controller = "Home", Key .Action = "SchedulerPartial"}
settings.EditAppointmentRouteValues = New With {Key .Controller = "Home", Key .Action = "EditAppointment"}

asp-net-mvc-scheduler-appointment-edit-form/VB/Code/SchedulerHelper.vb#L25

vb
settings.Name = "scheduler"
settings.CallbackRouteValues = New With {.Controller = "Home", .Action = "SchedulerPartial"}
settings.EditAppointmentRouteValues = New With {.Controller = "Home", .Action = "EditAppointment"}

See Also

Get Started

Callback-Based Functionality

SchedulerSettings Class

SchedulerSettings Members

DevExpress.Web.Mvc Namespace