我有一个带有适当 OnClick 的 asp:button。我还有一个 jQuery UI 对话框,当单击所述按钮时会打开。我希望当用户在对话框中单击“是”时调用 OnClick 函数。如果“是”调用一个代码隐藏函数,“否”调用另一个代码隐藏函数,那就更好了。但对于我的生活,我无法弄清楚如何。
这是我当前的代码:
$(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');
});
});
和按钮:
<asp:Button ID="testerE" class="navigation" runat="server" OnClick="JustATest" Text="Test me" />