eo_MsgBox Function

Displays a message box.

Syntax
JavaScript
 function eo_MsgBox(msgBoxId, title, msg, icon, buttons)

Parameters

msgBoxId
The ClientID of the MsgBox control.
title
The message box title.
msg
The message text.
icon
The message box icon.
buttons
An array of message box buttons, see remark section for details.
Remarks

Call this function to display a message box.

Each button is an object with the following properties:

Property Remark
Text Client side equivalent to Text.
ClientSideHandler Client side equivalent to ClientSideHandler.
CommandName Client side equivalent to CommandName.

To provide one or more message box buttons, use the following syntax:

JavaScript
eo_MsgBox("MsgBox1",                //ClientID of the MsgBox control
    "Confirm Delete",                //Message box title
    "Are you sure you want to delete this item?",    //Message box text
    null,                            //No message box icon
    
    //Providing an array of buttons
    [
        //Add a "Yes" button that triggers server side 
        //ButtonClick event with command name "Delete"
        {
            Text: "Yes",
            CommandName: "Delete"
        },
        
        //Add a "No" button triggers a client side function 
        //provided through ClientSideHandler member. You can 
        //also uses a function name here, for example:
        //    ClientSideHandler: "on_delete_canceled"
        {   
            Text: "No",
            ClientSideHandler: "on_msgbox_canceled"
        },
        
        //Add a "Cancel" button to close the msgbox because it 
        //provides neither a ClientSideHandler nor a CommandName
        {
            Text: "Cancel"
        }
    ]);
See Also