【问题标题】:close a popup modal and true the value on click event关闭弹出模式并设置点击事件的值
【发布时间】:2015-05-21 18:31:32
【问题描述】:

我正在尝试创建一个弹出窗口并在其上放置 2 个按钮,当单击按钮时 btn 的值为 true 并关闭弹出窗口并查看主窗口, 我做了一些事情!但是当主窗口加载它的灰色! 我的意思是:

还有这个:

当在浏览器中按 F12 时,我会看到:

<body class="modal-open" style=""></body>

这是我的 .cshtml 文件:

@{
    List<string> formRows = new List<string>();

    string btnReceiptPrint = string.Format(@"<button id='BtnReceiptPrint' style='height:35px;width:110px;' class='btn btn-success' type='button' 
                    onclick='$(""#ReceiptPrint"").val(""true"");hideModal(this);_submitForm(""sellInvoiceForm"");'>{0}</button>", Resources.UI("ReceiptPrint"));

    string btnNormalPrint = string.Format(@"<button id='BtnNormalPrint' style='height:35px;width:110px;' class='btn btn-success' type='button' 
                    onclick='$(""#NormalPrint"").val(""true"");hideModal(this);_submitForm(""sellInvoiceForm"");'>{0}</button>", Resources.UI("NormalPrint"));

    formRows.Add("<p style ='text-align : center'>" + btnReceiptPrint + "</p>");
    formRows.Add("<p style ='text-align : center'>" + btnNormalPrint + "</p>");

    @Html.FormGroupGenerator(formRows)
}

谁能帮我PLZ?

【问题讨论】:

    标签: javascript html asp.net ajax


    【解决方案1】:

    当你按下 btn 然后执行:$('#your-modal').modal('hide')。它将关闭模态。

    【讨论】:

      猜你喜欢
      • 2019-02-27
      • 2018-04-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-27
      • 1970-01-01
      • 2016-03-01
      • 1970-01-01
      相关资源
      最近更新 更多