Skip to content

ConfirmButtonExtender

MikhailTymchukDX edited this page Aug 24, 2016 · 2 revisions

Demo Page

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

Name Description
RegisterDisplayModalPopup() Registers the target of DisplayModalPopupID for use with ConfirmButton.

Client properties

Name Description
confirmOnFormSubmit A Boolean value that specifies that the confirm dialog box should not be displayed until the form is submitted.
confirmText Confirmation text to display.
displayModalPopupID A string that contains the ID of the ModalPopupBehavior control for use instead of the default window.confirm dialog box.
onClientCancel A string that contains a client script that executes when the Cancel button is clicked in the confirm dialog box.
postBackScript A string that contains script to run in order to initiate a postback.

Client events

Name Description
hidden Fires when the control is hidden.
showing Fires when the control is being shown.

Client properties

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)

confirmText

Confirmation text to display.

Remarks: HTML entities can be used for a newline character.

Getter name: get_confirmText()
Setter name: set_confirmText(value)

confirmOnFormSubmit

A Boolean value that specifies that the confirm dialog box should not be displayed until the form is submitted.

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.

Getter name: get_confirmOnFormSubmit()
Setter name: set_confirmOnFormSubmit(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)

postBackScript

A string that contains script to run in order to initiate a postback.

Getter name: get_postBackScript()
Setter name: set_postBackScript(value)

Methods

RegisterDisplayModalPopup()

Registers the target of DisplayModalPopupID for use with ConfirmButton.

Remarks: Called in OnLoad by default, but can be called later if the ModalPopup/ConfirmButton are created dynamically.

Client events

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()

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()

Clone this wiki locally