November Happy Hour will be moved to Thursday December 5th.

Class AlertEvent

Displays a client side alert box for when the specified event occurs on the target control

Inheritance
System.Object
AlertEvent
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.ClientScript.Events
Assembly: EPiServer.Cms.AspNet.dll
Version: 11.20.7
Syntax
public class AlertEvent : EventBase

Constructors

AlertEvent(EventType)

Create a new Alert dialog event

Declaration
public AlertEvent(EventType eventType)
Parameters
Type Name Description
EventType eventType

The client side event to show the alert dialog for

AlertEvent(EventType, String)

Create a new Alert dialog event with the alert message specified

Declaration
public AlertEvent(EventType eventType, string message)
Parameters
Type Name Description
EventType eventType

The client side event to show the alert dialog for

System.String message

Message shown in the alert dialog

AlertEvent(EventType, String, String)

Create a new Alert dialog event with alert message and a client side conditional statement specified

Declaration
public AlertEvent(EventType eventType, string message, string condition)
Parameters
Type Name Description
EventType eventType

The client side event to show the confirmation dialog for

System.String message

Message shown in the alert dialog

System.String condition

Client script conditional statement used to decide whether the alert dialog is shown.

Examples

AlertEvent alertEvent = new AlertEvent(EventType.Click, "Hello World!", "document.getElementById('myCheckbox').checked == true")

Properties

AlertCondition

Client script conditional statement used to decide whether the alert dialog is shown.

Declaration
public string AlertCondition { get; set; }
Property Value
Type Description
System.String
Remarks

If the statement evaluates to true the confirmation dialog is shown otherwise the dialog will be supressed.

Examples
    confirmEvent.ConfirmCondition = "document.getElementById('myCheckbox').checked == true";

AlertMessage

Message shown in the alert dialog

Declaration
public string AlertMessage { get; set; }
Property Value
Type Description
System.String
Remarks

Client script escape characters will be escaped before the string is emitted to the client.

Methods

AttachEvent(ScriptManager, String)

Attaches the alert dialog event to the supplied script manager

Declaration
public override void AttachEvent(ScriptManager scriptManager, string clientId)
Parameters
Type Name Description
ScriptManager scriptManager
System.String clientId
Overrides

Extension Methods