AutoCompleteBoxBaseSettings.CallbackRouteValues Property
Specifies the names of a Controller and an Action that handle callbacks.
Namespace: DevExpress.Web.Mvc
Assembly: DevExpress.Web.Mvc5.v24.2.dll
Declaration
Property Value
Type | Description |
---|---|
Object | An object that contains the Controller and Action names. |
Remarks
@Html.DevExpress().ComboBox(settings => {
settings.Name = "comboBox";
settings.CallbackRouteValues = new { Controller = "Editors", Action = "ComboBoxPartial" };
<!-- ... -->
}).BindList(Model).GetHtml()
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.
- 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).
- 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.
@Html.DevExpress().ComboBox(settings => {
settings.Name = "ComboBox";
...
settings.CallbackRouteValues = new {
Controller = "Home",
Action = "IndexPartial",
myComplexData = Json.Encode(Model.myListData)
};
}).GetHtml()
public ActionResult IndexPartial(string SelectedIds) {
List<int> myData = System.Web.Helpers.Json.Decode<List<int>>(myComplexData);
...
}
See Also