【问题标题】:how to render an html page in other html page as a popup window on a button click using mvc5 asp.net如何使用 mvc5 asp.net 将其他 html 页面中的 html 页面呈现为按钮单击时的弹出窗口
【发布时间】:2016-01-24 15:55:37
【问题描述】:
  <body>
    <p>Click the button to show the dialog.</p>

       <button onclick="myFunction()">Show dialog</button>

       <dialog id="myDialog" style="position:absolute; top:0px;left:0px">@RenderPage("popup.cshtml")  </dialog>


    <script>
       function myFunction() {
          document.getElementById("myDialog").showModal();
      }

它正在正确呈现我的页面,但问题是那个对话框。我不想要我只想呈现我的部分视图页面的对话框。请帮助我这样做。

【问题讨论】:

    标签: javascript html asp.net-mvc-5 partial-views


    【解决方案1】:

    如果您有一个 HTML 页面,您可以使用按钮上的href 属性链接到另一个 HTML 页面,该属性会将您定向到另一个页面。

    <button>
         <a href="otherpage.html">Show Dialog</a>
    </button>
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-07-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-11-13
    相关资源
    最近更新 更多