This was my precedent implementation:
In example.aspx:
<asp:Button ID="rejectButton" runat="server" Text="REJECT" OnClick="OnRejectButtonClick"/>
and in example.aspx.cs:
protected void OnRejectButtonClick(object sender, EventArgs e)
{
// a lot of stuff...
rejecter();
}
... this works.
Now I need a dialog for confirm the rejecting. Now my code is:
In example.aspx:
<asp:Button ID="rejectButton" runat="server" Text="REJECT" OnClientClick="return openDialog();"/>
<div id="dialog" title="Seleziona causa">
<p>... bla bla...</p>
</div>
<script>
$(function () {
$("#dialog").dialog({ autoOpen: false, modal: true, show: "blind", hide: "blind",
buttons: {
"Okay": function () {
OnRejectButtonClick; // DOESN'T WORK!
$(this).dialog("close");
},
"Annulla": function () {
$(this).dialog("close");
}
}
});
});
function openDialog() {
$("#dialog").dialog("open");
return false;
}
</script>
and example.aspx.cs is not changed.
But after this changing, the call to OnRejectButtonClick event doesn't fire anymore. How can I fix this?