Hello,
I’ve been using a ConfirmButtonExtender with success in my
web app but have hit a snag that is making me pull my hair out. In short,
the assigned OnClientCancel function does not execute, even if the Cancel
button is clicked by the user. In fact I can assign an OnClientCancel
function that doesn’t exist and compile still completes without error.
I’ve tried setting breakpoints (which are not triggered), changing the function
name, deleting the extender and recreating it all with no luck. Is this a
known issue or is there something obvious that I could be doing wrong?
I’ve included some code for clarity.
The button with attached extender:
<asp:Button ID="btnDPKSubmit" runat="server" CssClass="button" Text="btnDpkSubmit"
PostBackUrl="~/RIManager.aspx" Visible="False"
onclick="btnSubmit_Click" />
<cc1:ConfirmButtonExtender ID="btnDPKSubmit_ConfirmButtonExtender"
runat="server" ConfirmText="" Enabled="True" TargetControlID="btnDPKSubmit" OnClientCancel="CancelClick">
</cc1:ConfirmButtonExtender>
<asp:Button ID="btnDPKSubmit" runat="server" CssClass="button" Text="btnDpkSubmit"
PostBackUrl="~/RIManager.aspx" Visible="False"
onclick="btnSubmit_Click" />
<cc1:ConfirmButtonExtender ID="btnDPKSubmit_ConfirmButtonExtender"
runat="server" ConfirmText="" Enabled="True" TargetControlID="btnDPKSubmit" OnClientCancel="CancelClick">
</cc1:ConfirmButtonExtender>
I placed a breakpoint at:
protected void CancelClick()
{
_confirmed = false;
}
But it never gets triggered, the code goes straight to btnSubmit_Click.
Can someone lend me a hand here?
thanks,
Trevor