簡體   English   中英

在asp.net中彈出我的新頁面

[英]Open my new page in pop up in asp.net

我有一個常規頁面。當我點擊一個按鈕時,它將在該頁面中打開,帶有一些asp控件。 我需要的是,我想在彈出頁面打開該頁面,里面有關閉按鈕。我搜索但是我沒有找到適當的鱈魚。 有誰能夠幫助我? 謝謝 在此輸入圖像描述

你可以在javascript中使用windows.open。

    <html>
    <body>

    <script type="text/javascript">
function windowOpen() {
    myWindow=window.open('http://myurl.com','_blank','width=200,height=100, scrollbars=no,resizable=no')

    myWindow.focus()
}
    </script>
    <input type="button" value="Open Window" onclick="windowOpen()">
    </body>
    </html>

在功能之前使用return

 <html>
<body>

<script type="text/javascript">
  function windowOpen() {
      myWindow=window.open('http://myurl.com','_blank','width=200,height=100, scrollbars=no,resizable=no')
      myWindow.focus()
      return false;
  }
</script>
<asp:button id="btnClick" text="Open Window" onClientClick="return windowOpen()">
</body>
</html>
<script type="text/javascript">
    function OpenPopup() {

       window.open("ProductClass.aspx", "List", "toolbar=no, location=no,status=yes,menubar=no,scrollbars=yes,resizable=no, width=900,height=500,left=430,top=100");
        return false;
    }
</script>

使用以下代碼

ClientScript.RegisterStartupScript(typeof(Page),“MessagePopUp”,“window.location.href ='Home.aspx';”,true);

大家好請使用以下代碼

function ShowPopup() {
        $("#panOne").dialog({
            autoOpen: true,
            appendTo: "form",
            height: 600,
            width: 900
        });
    }

appendTo"form"很重要,好像你沒有使用它會自動autopostback所有值

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM