Class PageLeaveCheckEvent
Attaches to the window load event of the client and initializes change listeners for input fields. If input fields has changed when the page is about to be unloaded a confirm dialog is shown to notify the user about unsaved changes. By using the DisablePageLeaveEvent event the leave dialog can be supressed.
Inherited Members
Namespace: EPiServer.ClientScript.Events
Assembly: EPiServer.Cms.AspNet.dll
Version: 11.20.7Syntax
public class PageLeaveCheckEvent : EventBase
Constructors
PageLeaveCheckEvent()
Creates a new empty PageLeaveCheckEvent
Declaration
public PageLeaveCheckEvent()
PageLeaveCheckEvent(String)
Creates a new PageLeaveCheckEvent with the page leave message set
Declaration
public PageLeaveCheckEvent(string pageLeaveMessage)
Parameters
Type | Name | Description |
---|---|---|
System.String | pageLeaveMessage | The message shown when a user leaves a page with unsaved changes |
Properties
EventType
The client side event for which the event is triggered.
Declaration
public override EventType EventType { get; set; }
Property Value
Type | Description |
---|---|
EventType |
Overrides
Remarks
Always returns Load.
PageLeaveMessage
The message shown when a user leaves a page with unsaved changes
Declaration
public string PageLeaveMessage { get; set; }
Property Value
Type | Description |
---|---|
System.String | Returns System.String.Empty if undefined or set to null. |
Methods
AttachEvent(ScriptManager, String)
Attaches the event to the ScriptManager
Declaration
public override void AttachEvent(ScriptManager scriptManager, string clientId)
Parameters
Type | Name | Description |
---|---|---|
ScriptManager | scriptManager | Reference to an ScriptManager instance |
System.String | clientId | The control that will raise the event |