Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Modal Pop Up with Condirm Button

$
0
0

Hi, I have a button which pops up a modal, the user can then click on ok or cancel.

I want to make it so that if the ok button is clicked it runs some server side code, and if cancel is clicked it does nothing.

below is my code, when ok is clicked it works how I want it to. The problem is when cancel is clicked it also runs the code, how can I stop it running the server side code when cancel is clicked?

Many Thanks

    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </asp:ToolkitScriptManager>
    <asp:Label ID="Label1" runat="server" Text="Click this button to open AJAX Confirm box:" Font-Bold="true" Font-Size="16px"></asp:Label><br />
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:Button ID="btnConfirm" runat="server" Text="Confirm1" OnClick="SupervisorDeclineRequest_Click" />
            <asp:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" TargetControlID="btnConfirm"
                ConfirmText="Are you sure?&#10;You want to run the server code." OnClientCancel="onCancel" ConfirmOnFormSubmit="false" >
            </asp:ConfirmButtonExtender>
            <asp:Label ID="lblMessage" runat="server"></asp:Label><br />
        </ContentTemplate>
    </asp:UpdatePanel>




Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>