简体   繁体   English

在asp.net中弹出我的新页面

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

I have a regular page.When i clicked on a button it will be open in that page with some asp controls. 我有一个常规页面。当我点击一个按钮时,它将在该页面中打开,带有一些asp控件。 what i need is that i want to open that page in a pop up page with close button inside it.I searched but i didn't find a properly cod for this. 我需要的是,我想在弹出页面打开该页面,里面有关闭按钮。我搜索但是我没有找到适当的鳕鱼。 can any body help me? 有谁能够帮助我? thanks 谢谢 在此输入图像描述

You can use windows.open in javascript. 你可以在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>

Use return before your function 在功能之前使用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>

Use the below code 使用以下代码

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

hi all Kindly use the below code 大家好请使用以下代码

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

appendTo : "form" is Important as if you are not using it will autopostback all values appendTo"form"很重要,好像你没有使用它会自动autopostback所有值

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM