MobileWindowTemplate.RegisterClientScriptOnShow(String, String) Method

Registers a client script to be executed on a View show.

Namespace: DevExpress.ExpressApp.Mobile.Templates

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

Syntax

public void RegisterClientScriptOnShow(
    string scriptName,
    string script
)

Parameters

Type Name Description
String scriptName

A string that is a script name.

String script

A string that is a script to be executed on a View show.

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

using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Mobile;
using DevExpress.ExpressApp.Mobile.Templates;
//...
public class ClientScriptsController : ViewController {
    //...
    protected override void OnViewControlsCreated() {
        base.OnViewControlsCreated();
        if (((MobileApplication)Application).ClientApplicationCreating) {
            ((MobileWindowTemplate)Frame.Template).RegisterClientScriptOnShow("AlertOnShow", @"  
                DevExpress.ui.notify({   
                    closeOnClick: true,   
                    message: 'The window '+$model.name+' is shown.',  
                    type: 'info'   
                });"
            );
        }
    }
}