javascript - 从 asp.net 代码隐藏关闭 Bootstrap 模式

标签 javascript asp.net twitter-bootstrap

我找到了这个答案,但收到以下错误:

脚本:

<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/

相关文章:

javascript - 如何将内容加载到导航栏上的节元素中单击

javascript - Node.js - 在 Server.js 上执行 Node 命令(Express + React + Webpack)

javascript - 我可以传递引用之类的参数吗

asp.net - 每个网页的单独CSS

c# - ASP.NET:检查是否从迁移运行

asp.net - ASP.NET中如何从页面外部获取 session 值

JQuery/bootstrap 加载和附加表

html - 是否可以在超大 div 的 Bootstrap 列中设置背景?

javascript - 使用 jQuery 获取文档的实际高度

javascript - 如何自定义Nihilo.css?