I'm trying to invoke a BootstrapDialog.confirm() by asp:LinkButton on a custom SharePoint WebPart this way:
<asp:LinkButton runat="server" OnClientClick="BootstrapDialogPopup(this);return false;" OnClick="btn_Click" />
And BootstrapDialog function is:
function BootstrapDialogPopup(param) {
BootstrapDialog.confirm({
title: 'Cancel',
message: 'Are you sure?!',
type: BootstrapDialog.TYPE_DEFAULT,
closable: true,
draggable: true,
btnCancelLabel: 'Cancel',
btnOKLabel: 'Ok',
btnOKClass: 'btn-warning',
callback: function (result) {
if (result) {
javascript: __doPostBack(param.name, '');
} else {
BootstrapDialog.closeAll();
}
}
});
}
But, once i clicked on asp:LinkButton its server side click event(btn_Click) get called before i get the chance to choose 'Ok' or 'Cancel'.
So, My question is: How to hold the Button server event until i get the chance to choose'Ok' or 'Cancel'.
Please note that this issue occurs only on SharePoint environment.