我正在尝试以这种方式在自定义SharePoint WebPart上调用BootstrapDialog.confirm() by asp:LinkButton:
<asp:LinkButton runat="server" OnClientClick="BootstrapDialogPopup(this);return false;" OnClick="btn_Click" />
而BootstrapDialog函数是:
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();
}
}
});
}
但是,一旦我点击了它的服务器端,在我有机会选择'Ok‘或'Cancel’之前,就点击了get called。
所以,我的问题是:如何保持按钮服务器事件,直到我有机会选择‘Ok’或'Cancel‘。
请注意,此问题仅在SharePoint环境上出现。
https://stackoverflow.com/questions/50769259
复制相似问题