TargetControlID - The ID of the Button Control to extend.(要進行擴充的按鈕控制項)
ConfirmText - The confirmation text to display.HTML entities can be used,such as for a newline character.(要顯示的確認文本,可以是HTML實體,如一個分行符號)
OnClientCancel - The Client script to execute when the Cancel button is clicked in the confirm dialog box.(當單擊確認對話方塊“取消”按鈕時所執行的用戶端指令碼)
ConfirmOnFormSubmit - true if the confirm dialog box should 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 should be displayed only after all validation checks pass.false(default).(當值設定為true時,確認對話方塊只有在表單提交時才顯示,這在頁麵包含ASP.NET驗證控制項(也就是確認對話方塊只有在所有驗證控制項都通過時才顯示)是很有用的。)
DisplayModalPopID - Speicifies the ID of a ModalPopup control to use to display the confirm dialog box.instead of the default window.confirm window. When you use the DisplayModalPopupID property, the following conditions must be met:
a.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.)
b.The ModalPopup control must specify the OkControlID or the CancelControlID properties in order to identify the buttons that correspond to the the OK and Cancel buttons in the confirm dialog box.
c.The ModalPopup must not specify a OnOkScript or OnCancelScript property.
(這個屬性(低版本中沒有)比較麻煩哦,不過如果你想追求更好的表現效果的話,可以與ModalPopup組合使用,當使用該屬性的時候也就代替了預設的JavaScript window.confirm 視窗,而且你必須作如下設定:
a.ModalPopup控制項的TargetControlID必須和ConfirmButton控制項的一致;
b.ModalPopup控制項中必須設定有效OkControlID和CancelControlID以和確認對話方塊的“確認”、“取消”按鈕相一致;
c.必須設定對應的OnOkScript和OnCancelScript處理指令碼。)
參看ModalPopup
<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="Button1_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 void Button1_Click(object sender, EventArgs e)
{
Label1.Text = "Text from the serverside.";
}