ConfirmButton Extender (demo)

ConfirmButton is an extender that catches button clicks (or click on an instance of a type that is derived from Button) and displays a message to a user. If the user clicks OK, the button or link functions normally. If the user does not click OK, the click event is trapped and the button does not perform its default submit behavior.

Properties

Name Description
ConfirmOnFormSubmit True if the confirm dialog should run for form submission (i.e., after validators are all satisfied). The default is false Remarks: This is useful if a page contains ASP.NET validator controls and the confirm dialog box should be displayed only after all validation checks pass.
ConfirmText Confirmation text to display. Remarks: HTML entities can be used for a newline character.
DisplayModalPopupID Specifies an ID of a pre-configured ModalPopupExtender for use instead of window.confirm. Remarks: When you use the DisplayModalPopupID property, the following conditions must be met: - The ModalPopup control must be configured with the same TargetControlID value as the ConfirmButton extender. (It will work properly if the ConfirmButton extender is disabled.) - The ModalPopup control must specify the OkControlID or CancelControlID property to identify buttons that correspond to the OK and Cancel buttons in the confirm dialog box. - The ModalPopup must not specify the OnOkScript or OnCancelScript property.
OnClientCancel A client script to be executed when the Cancel button is clicked in the confirm dialog box.
PostBackScript Specifies the script to run to initiate a postback.

Methods

RegisterDisplayModalPopup()
Registers the target of DisplayModalPopupID for use with ConfirmButton.
Called in OnLoad by default, but can be called later if the ModalPopup/ConfirmButton are created dynamically.

Client properties

confirmOnFormSubmit
A Boolean value that specifies that the confirm dialog box should not be displayed until the form is submitted.
Getter name: get_confirmOnFormSubmit()
Setter name: set_confirmOnFormSubmit(value)

confirmText
Confirmation text to display.
Getter name: get_confirmText()
Setter name: set_confirmText(value)

displayModalPopupID
A string that contains the ID of the ModalPopupBehavior control for use instead of the default window.confirm dialog box.
Getter name: get_displayModalPopupID()
Setter name: set_displayModalPopupID(value)

onClientCancel
A string that contains a client script that executes when the Cancel button is clicked in the confirm dialog box.
Getter name: get_onClientCancel()
Setter name: set_onClientCancel(value)

postBackScript
A string that contains script to run in order to initiate a postback.
Getter name: get_postBackScript()
Setter name: set_postBackScript(value)

Client events

hidden
Fires when the control is hidden.
Add event handler method: add_hidden(handler)
Remove event handler method: remove_hidden(handler)
Raise event method: raise_hidden()

showing
Fires when the control is being shown.
Add event handler method: add_showing(handler)
Remove event handler method: remove_showing(handler)
Raise event method: raise_showing()

Last edited Sep 14, 2015 at 10:04 AM by fadilmamedov, version 2