首页 > 解决方案 > 为什么 bootstrap-modal 表单打开但不可见?

问题描述

我已经从另一个项目中获取了我的项目,但是在更新了 nuget 中的所有引用之后。我的引导模式表单现在似乎已加载,但它们不可见。

我已经搜索过类似的问题,但尚未找到任何解决方案。Chrome 中的开发者控制台没有显示任何脚本错误,我迷路了。

这就是我打开表单的方式:

{
   @*<div class="modal hide fade" id="AddCustomerRecordUI">*@
   <div class="modal fade" id="AddCustomerRecordUI">
      <div class="modal-dialog">
         <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
               &times;
            </button>
            <h3>Customer Record</h3>
         </div>
         <div class="modal-body">
            @*@Html.HiddenFor(x => x.BranchDetails.OrganisationId, new { Value = Model.OrgId })*@
            <div class="row-fluid AddCustomerRecordData">
            </div>
         </div>
         <div class="modal-footer">
            <input type="submit" id="btnAddCustomerRecord" class="btn btn-primary" value="Save" />
            <a href="#" class="btn" data-dismiss="modal">Cancel</a>
         </div>
      </div>
   </div>
}

表单内容来自局部视图:

<div class="row-fluid">
   <div class="span12">
      @Html.LabelFor(x => x.Name)
      @Html.TextBoxFor(x => x.Name, new { @class = "input-block-level" })
      @Html.LabelFor(x => x.Address)
      @Html.TextBoxFor(x => x.Address, new { @class = "input-block-level" })
      @Html.LabelFor(x => x.PersonalProof)
      @Html.DropDownListFor(x => x.PersonalProofId, Model.PersonalProof, "--Select Personal Proof--", new { @class = "input-block-level" })
      @Html.LabelFor(x => x.ProofNumber)
      @Html.TextBoxFor(x => x.ProofNumber, new { @class = "input-block-level" })
      @Html.LabelFor(x => x.ProofOfEntitlement)
      @Html.DropDownListFor(x => x.ProofOfEntitlementId, Model.ProofOfEntitlement, null, new { @class = "input-block-level" })
      @Html.LabelFor(x => x.EntitlementNumber)
      @Html.TextBoxFor(x => x.EntitlementNumber, new { @class = "input-block-level" })
   </div>
</div>

并使用以下 javascript 打开:

$("body").on("click", ".customer-records", function(e) {
    var ui = $("#AddCustomerRecordUI")

    $.post("NewRecordBuilder", {
        id: "123"
    }, function(html) {
        ui.find(".AddCustomerRecordData").html(html);
        ui.modal("show");
    })
});

似乎表单打开但不可见。因此,我的网页看起来很正常,但我无法点击它。

我知道模态表单在那里,因为我可以移动鼠标指针,指针会在文本和下拉列表上切换,我可以获得一个下拉列表来显示项目,我只是看不到它所在的表单?

标签: jqueryasp.net-mvcbootstrap-modal

解决方案


推荐阅读