Bootstrap 对话框 - 如何阻止它自动关闭

Bootstrap Dialog - How do I stop it closing automatically

我正在使用 Ajax 调用 MVC 控制器来提交表单,调用成功后我想显示一个对话框,目前它按我想要的方式工作,但该框打开大约一秒钟然后关闭。

$("#addBtn").click(function () {
    $(".container form").ajaxSubmit({ url: '/umbraco/Surface/Basket/AddNow', type: 'post', success: function () { afterSuccess(); } })
});

function afterSuccess() {
    BootstrapDialog.alert('Test');
}

为什么会这样?

问题不在 Java 脚本中,问题在页面的 html 中。我将提交按钮移到了表单的一侧。

这种事一定经常发生! - 希望这对其他人有所帮助。