Introduction:
ConfirmButton is a simple extender that catches clicks on a button and displays a message to the user. If the "OK" button is clicked, the button or link functions normally. If not, the click is trapped and the button will not perform its default submit behavior; optionally, a client script is executed if the OnClientCancel property is set. This is useful for delete links or anything else that requires confirmation from the user.
When Ever You Want to Use Ajax Controls in your website First you need Add.
AjaxControlToolkit reference to your application.
<%@ Register
Assembly="AjaxControlToolkit"
Namespace="AjaxControlToolkit"
TagPrefix="asp"
%>
You can Change TagPrefix Also,Some Exaples tagPrefix="ajax", tagPrefix="cc1",tagPrefix="asp"
And also you have to add Tool kit Scriptmanager Control under <Form> tag:
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
ConfirmButton is a simple extender that catches clicks on a button and displays a message to the user. If the "OK" button is clicked, the button or link functions normally. If not, the click is trapped and the button will not perform its default submit behavior; optionally, a client script is executed if the OnClientCancel property is set. This is useful for delete links or anything else that requires confirmation from the user.
When Ever You Want to Use Ajax Controls in your website First you need Add.
AjaxControlToolkit reference to your application.
<%@ Register
Assembly="AjaxControlToolkit"
Namespace="AjaxControlToolkit"
TagPrefix="asp"
%>
You can Change TagPrefix Also,Some Exaples tagPrefix="ajax", tagPrefix="cc1",tagPrefix="asp"
And also you have to add Tool kit Scriptmanager Control under <Form> tag:
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
Your aspx page:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:ToolkitScriptManager
ID="ToolkitScriptManager1"
runat="server">
</asp:ToolkitScriptManager>
<div>
<asp:Button ID="Button1"
runat="server"
Text="Button"
/>
<asp:ConfirmButtonExtender
ID="ConfirmButtonExtender1"
runat="server"
TargetControlID="Button1"
ConfirmText="Are you
sure you want to click this?" OnClientCancel="CancelClick">
</asp:ConfirmButtonExtender>
</div>
<div>
<asp:LinkButton ID="LinkButton1"
runat="server">LinkButton</asp:LinkButton>
<asp:ConfirmButtonExtender
ID="ConfirmButtonExtender2"
runat="server"
TargetControlID="LinkButton1"
ConfirmText="Are you
sure you want to click this?" OnClientCancel="CancelClick">
</asp:ConfirmButtonExtender>
</div>
</form>
</body>
</html>
|