1. 程式人生 > >bootstrap之彈出框

bootstrap之彈出框

get fun tro return dialog 聲明 w3c partial mod

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

bootstrap之彈出框