user1877170
user1877170

Reputation:

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 enter image description here

Upvotes: 1

Views: 33664

Answers (5)

suraj gorad
suraj gorad

Reputation: 51

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

Upvotes: 0

user3076772
user3076772

Reputation: 34

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

Upvotes: 1

Sumant
Sumant

Reputation: 163

Use the below code

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

Upvotes: 1

शेखर
शेखर

Reputation: 17614

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>

Upvotes: 1

Elad Lachmi
Elad Lachmi

Reputation: 10561

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>

Upvotes: 1

Related Questions