MobileApplication.RegisterClientScriptOnApplicationStart(String, String) Method

Registers a client script to be executed on application startup.

Namespace: DevExpress.ExpressApp.Mobile

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

Syntax

public void RegisterClientScriptOnApplicationStart(
    string scriptName,
    string script
)

Parameters

Type Name Description
String scriptName

A string that is a script name.

String script

A script to be executed on application startup.

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

using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Mobile;
//...
public class ClientScriptsController : ViewController {
    //...
    protected override void OnActivated() {
        base.OnActivated();
        if (((MobileApplication)Application).ClientApplicationCreating) {
            MobileApplication.RegisterClientScriptOnApplicationStart("AlertScript", @"  
                DevExpress.ui.notify({   
                    closeOnClick: true,   
                    message: 'The Application successfully started.',  
                    type: 'success'   
                });"
            );
        }
    }
}