如何在不使用J-query的情况下在asp mvc中将我的部分视图页面作为弹出窗口

时间:2019-04-02 06:51:19

标签: c# asp.net-mvc

我正在从事MVC项目,并希望在单击按钮时创建一个模式弹出窗口。 但是不使用J查询。这可能吗?如果是这样的话,给大家一些建议 预先感谢!

1 个答案:

答案 0 :(得分:0)

使用引导程序模式

<!-- Button trigger modal -->
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal">
  Show popup
</button>
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
       @Html.Partial("yourView")
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
        <button type="button" class="btn btn-primary">Save changes</button>
      </div>
    </div>
  </div>
</div>
相关问题