简体   繁体   中英

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. 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.

    <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

 <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);

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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