我找到了这个答案,但收到以下错误:
脚本:
<script type="text/javascript">
function Closepopup() {
debugger;
$('#myModal').modal('close');
}
</script>
代码隐藏:
ScriptManager.RegisterStartupScript(Me, Me.GetType, "Close Modal Popup", "Closepopup();", True)
错误:
http://localhost:1230/Scripts/bootstrap.min.js 中第 6 行第 13594 列未处理的异常
0x800a01b6 - JavaScript 运行时错误:对象不支持“关闭”属性或方法
任何想法表示赞赏!
最佳答案
modal('toggle')
而不是 modal(toggle)
$(function () {
$('#modal').modal('toggle');
});
关于javascript - 从 asp.net 代码隐藏关闭 Bootstrap 模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30552061/