I have some code like below in an aspx page:
...
function CheckEditing() {
var answer = confirm('You are currently editing an item. If you continue to the next page your changes will not be saved. Would you like to continue?');
if(!answer)
{
return false;
}
return true;
}
.....
<asp:Button ID="btn_Next" runat="server" Text="Next" onclick="btn_Next_Click" OnClientClick="CheckEditing();" />
I had thought that returning false would keep my asp.net OnClick even from firing, but it still does. I've confirmed that it is getting to the return false
section of code using alerts. Is there anything I can do to stop it from firing using jQuery/javascript?