繁体   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