The requested page is not available for the requested platform. You are viewing the content for Default platform.
A newer version of this page is available. Switch to the current version.

ActionBaseExtensions.RegisterClientScriptOnExecute(ActionBase, String, String) Method

Register a client script to be executed on an Action execute.

Namespace: DevExpress.ExpressApp.Actions

Assembly: DevExpress.ExpressApp.Mobile.v18.2.dll


public static void RegisterClientScriptOnExecute(
    this ActionBase action,
    string scriptName,
    string script
Public Shared Sub RegisterClientScriptOnExecute(
    action As ActionBase,
    scriptName As String,
    script As String


Name Type Description
action ActionBase

An Action on whose execution a client script will be executed.

scriptName String

A string that is a script name.

script String

A string that is the script to be executed on an Action execution.


You can use the actionParameter variable in a script which has different structure for each Action type:


The RegisterClientScriptOnExecute method does not work with the PopupWindowShowAction. So, if you use this Action, register a script for the dialog window's DialogController.AcceptAction.

The following example demonstrates how to use this method to show a text notification.

using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Actions;
using DevExpress.ExpressApp.Mobile;
public class ClientScriptsController : ViewController {
    private SingleChoiceAction singleChoiceAction;
    public ClientScriptsController() {
        singleChoiceAction = new SingleChoiceAction(this, "ClientSideAction", "");
        singleChoiceAction.Items.Add(new ChoiceActionItem("Item1", "Item 1", null));
        singleChoiceAction.SelectedIndex = 1;
    protected override void OnActivated() {
        if (((MobileApplication)Application).ClientApplicationCreating) {
            singleChoiceAction.RegisterClientScriptOnExecute("AlertScript", @"  
                    closeOnClick: true,   
                    message: 'ClientSideAction are executed. Selected item: ' + actionParameter.text,  
                    type: 'info'   

If a client script is not registered for an Action, it is processed on server-side by default.

singleChoiceAction.RegisterClientScriptOnExecute("ProcessOnServer", singleChoiceAction.GetProcessActionOnServerScript());

If you want to execute your script and then process the Action on the server-side, call the GetProcessActionOnServerScript method and add the result to your script registration:

singleChoiceAction.RegisterClientScriptOnExecute("AlertScriptWithProcessOnServer", @"  
        closeOnClick: true,   
        message: 'ClientSideAction are executed. Selected item: ' + actionParameter.text,  
        type: 'info'   
});" + singleChoiceAction.GetProcessActionOnServerScript());
See Also