The requested page is not available for the requested platform. You are viewing the content for Default platform.

MobileWindowTemplate.RegisterClientScriptOnLoad(String, String) Method

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

Namespace: DevExpress.ExpressApp.Mobile.Templates

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

Declaration

public void RegisterClientScriptOnLoad(
    string scriptName,
    string script
)
Public Sub RegisterClientScriptOnLoad(
    scriptName As String,
    script As String
)

Parameters

Name Type Description
scriptName String

A string that is a script name.

script String

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

Remarks

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).RegisterClientScriptOnLoad("AlertOnLoad", @"  
                DevExpress.ui.notify({   
                    closeOnClick: true,   
                    message: 'The window is loaded.',  
                    type: 'info'   
                });"
            );
        }
    }
}
See Also