bootstrap之弹出框

  1.模态框的核心在于 首先声明一个 模态框,标记其位置

<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">

  2.将页面生成的html代码放到模态框中,我这边是在控制器中返回视图填充模态框,然后将模态框show出来即可

   //作废
    function formInvalid(id) {
        $.ajax({
            type: 'GET',
            url: "/DCC/FormFile/FormInvalid?Id=" + id + "&temp=" + Date.parse(new Date()),
            success: function (res) {
                if (res.type == '@Constants.MessageBodyType.Error') {
                    $.hqmsg.showMsg({ content: res.message, msgtype: "@Constants.MessageBodyType.Error" });

                } else {
                    $("#common-modal").html(res);
                    $("#common-modal").modal("show");
                }
            }
        });
    }
 Control层:

return PartialView(model);

参考资料:https://www.w3cschool.cn/bootstrap/bootstrap-modal-plugin.html

原文地址:https://www.cnblogs.com/wang-min/p/10419133.html