Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]ASP.NET WebForms Controls
 [Collapse]ASP.NET MVC Extensions
  [Expand]Product Information
  [Expand]Getting Started
  [Collapse]Common Concepts
    Web Application Project Templates
    Insert Extension Wizard
    Data Binding
   [Expand]Applying Themes
    Client-Side API
    Declaring Server-Side Event Handlers
    Templates
    Using Callbacks
    Passing Values to a Controller Action through Callbacks
    Supported Attributes for Model Validation
    Using Extensions in Razor Views
  [Expand]Grid View
  [Expand]Card View
  [Expand]Vertical Grid
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]HTML Editor
  [Expand]Image and Data Browsing
  [Expand]Docking and Popups
  [Expand]Navigation and Layout Extensions
  [Expand]File Management
  [Expand]Multi-Use Site Extensions
  [Expand]Charts
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Tree List
  [Expand]Data Editor Extensions
  [Expand]Report Extensions
  [Expand]SpellChecker
 [Expand]Localization
 [Expand]Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Passing Values to a Controller Action through Callbacks

When a DevExpress MVC extension works in callback mode and requests the server via its own callback, you can use this callback to pass custom values collected on the client for further server processing. On the server side, you can process these values within a Controller action that is specified by the extension's CallbackRouteValues property. Depending upon the passed values, you can conditionally form the response to be sent back to the client.

By design, a callback (initiated by a DevExpress MVC extension) automatically passes values to the server. These are specific extension-related values, and the values of all internal form elements (e.g., input, textarea, select) rendered inside our extensions. To pass custom values from the client via a callback, you should handle an extension-specific BeginCallback client event. This event's argument provides you with the MVCxClientBeginCallbackEventArgs.customArgs property. This property represents a hash table object that can contain named values. Any named value assigned to the customArgs property is then passed to the server as a request parameter. On the server side, it can be accessed as a parameter of the specified Action. So, the necessary server-side actions can be performed in the handling Action based upon the value(s) passed from the client.

View:
Controller:

The following table lists DevExpress MVC extensions that expose the BeginCallback client event.

For an example of how to pass and process client values, please refer to the following online demo: Callback Panel - Example.

Expanded See Also

How would you rate this topic?​​​​​​​