How to open a new browser window in ASP.net?

Discussion in 'ASP .Net' started by Miguel Dias Moura, Apr 6, 2004.

  1. Hello,

    i have an ASP.net page with a button. When the button is clicked i want to
    open a new Browser window (400x200px) having only the title bar and nothing
    else.This browser window would load newpage.aspx in it.

    I would also like to know how to create a button to insert in newpage.aspx
    and that would close that same window.

    I have no idea of how to do this and until now i didn't find some
    information that might help me out.

    I am working in ASP.net / VB

    Thank You,
    Miguel
     
    Miguel Dias Moura, Apr 6, 2004
    #1
    1. Advertising

  2. This might get you started

    <html>
    <head>
    <script language="VB" runat="server">

    Sub Page_Load( sender as Object,e as EventArgs)

    'Form the script that is to be registered at client side.
    Dim scriptString as String = "<script language=JavaScript> function
    DoClick() {"
    ScriptString +=
    "window.open('http://www.mvps.org','MyWindow','width=400,height=200');}<"
    scriptString += "/"
    scriptString += "script>"

    If(Not IsClientScriptBlockRegistered("clientScript"))
    RegisterClientScriptBlock("clientScript", scriptString)
    End If
    End Sub
    </script>
    </head>
    <body topmargin="20" leftmargin="10">
    <form id="myForm" runat="server">

    <INPUT id="launchButton" onclick="DoClick();" type="button"
    value="Submit" name="myButton" runat="server">


    </form>
    </body>
    </html>

    --
    Regards

    John Timney
    Microsoft Regional Director
    Microsoft MVP


    "Miguel Dias Moura" <> wrote in message
    news:uqw#...
    > Hello,
    >
    > i have an ASP.net page with a button. When the button is clicked i want to
    > open a new Browser window (400x200px) having only the title bar and

    nothing
    > else.This browser window would load newpage.aspx in it.
    >
    > I would also like to know how to create a button to insert in newpage.aspx
    > and that would close that same window.
    >
    > I have no idea of how to do this and until now i didn't find some
    > information that might help me out.
    >
    > I am working in ASP.net / VB
    >
    > Thank You,
    > Miguel
    >
    >
     
    John Timney \(Microsoft MVP\), Apr 6, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Tm92aWNl?=
    Replies:
    2
    Views:
    6,701
    Alan Ferrandiz Langley
    Jun 9, 2004
  2. Shiperton Henethe
    Replies:
    17
    Views:
    5,471
    Deirdre Saoirse Moen
    May 21, 2004
  3. Gordon
    Replies:
    3
    Views:
    330
    Steven Burn
    Apr 16, 2004
  4. raj
    Replies:
    0
    Views:
    208
  5. PC HUA
    Replies:
    2
    Views:
    447
    PC HUA
    May 19, 2004
Loading...

Share This Page