I have an asp:button with appropriate OnClick. I also have a jQuery UI dialog that opens when said button is clicked. I would like the OnClick function to be called when the user clicks "Yes" in the dialog. Even better would be if one codebehind function was called for "Yes" and another for "No." But for the life of me I can't figure out how.
Here's my current code:
$(function() {
$("#dialog:ui-dialog").dialog("destroy");
$("#dialog-confirm").dialog({
autoOpen:false,
resizable:false,
height:175,
width: 450,
modal:true,
buttons: {
"Yes": function() {
$(this).dialog("close");
},
"No": function() {
$(this).dialog("close");
}
}
});
$(".navigation").click(function(e) {
e.preventDefault();
$("#dialog-confirm").dialog('open');
});
});
and the button:
<asp:Button ID="testerE" class="navigation" runat="server" OnClick="JustATest" Text="Test me" />
You are navigating away from this banner-IPG, do you want to save any changes?