Ajax Control Toolkit tutorial -- confirmbutton (OK)

Source: Internet
Author: User

Targetcontrolid-The ID of the button control to extend. (ButtonControls)

Confirmtext-The confirmation text to display. html entities can be used, such as & #10; for a newline character. (The confirmation text to be displayed can be an HTML object, such as a line break)

Onclientcancel-The client script to execute when the cancel button is clicked in the confirm dialog box. (The client script executed when you click "cancel" in the confirmation dialog box)

Confirmonformsubmit-True if the confirm dialog box shocould not be displayed until just before the form is submitted. this is useful if the page contains ASP. net validator controls and the confirm dialog box shoshould be displayed only after all validation checks pass. false (default ). (When the value is set to true, the confirmation dialog box is displayed only when the form is submitted, which contains ASP. net verification control (that is, the confirmation dialog box is displayed only when all verification controls are out of date) is very useful .)

Displaymodalpopid-Speicifies the ID of a modalpopup control to use to display the confirm dialog box. Instead of the defaultWindow. ConfirmWindow. When you useDisplaymodalpopupidProperty, the following conditions must be met:

A. The modalpopup control must be configured with the sameTargetcontrolidValue as the confirmbutton extender. (It will work properly if the confirmbutton extender is disabled .)

B. The modalpopup control must specifyOkcontrolidOrCancelcontrolidProperties in order to identify the buttons that correspond to the OK and cancel buttons in the confirm dialog box.

C. The modalpopup must not specifyOnokscriptOrOncancelscriptProperty.

(This attribute is not available in earlier versions), but you can use it in combination with modalpopup to achieve better performance, when this attribute is used, the default JavaScript window is replaced. confirm window, and you must make the following settings:

A. The targetcontrolid of the modalpopup control must be consistent with that of the confirmbutton control;
B. A valid okcontrolid and cancelcontrolid must be set in the modalpopup control to be consistent with the "Confirm" and "cancel" buttons in the confirmation dialog box;

C. The corresponding onokscript and oncancelscript processing scripts must be set .)

SeeModalpopup

<Demo>

 1   <  ASP: scriptmanager ID  = "Scriptmanager1"  Runat  = "Server"     />  
2 < Div >
3 < BR />
4 < ASP: Label ID = "Label1" Runat = "Server" Width = "273px" > </ ASP: Label > < BR />
5 < BR />
6 < ASP: button ID = "Button1" Runat = "Server" Onclick = "Button#click" Text = "Button" Width = "175px" />
7 < Ajaxtoolkit: confirmbuttonextender ID = "Confirmbuttonextender1" Runat = "Server" Targetcontrolid = "Button1"
8 Confirmtext = "Are you sure you want to submit? " >
9 </ Ajaxtoolkit: confirmbuttonextender >

 Protected VoidButton#click (ObjectSender, eventargs E)
{
Label1.text= "Text from the serverside.";
}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.