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
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。