Popup Window on Button Push

Discussion in 'ASP .Net' started by Temp, Aug 9, 2003.

  1. Temp

    Temp Guest

    Can anyone tell me how I can open a new browser window when a button is
    pressed?

    I tried adding an <a href=...> encapsulating the button, but it didnt work.

    Any suggestions?

    --
    _____________________________
    Ron Rodenberg
    Lead Software Engineer
    Razorvision Technology, Inc.
    (214) 207-1688
     
    Temp, Aug 9, 2003
    #1
    1. Advertising

  2. Temp

    vMike Guest

    look into the target tag. try target="_new" or target="_blank"
    "Temp" <> wrote in message
    news:bh34gd$...
    > Can anyone tell me how I can open a new browser window when a button is
    > pressed?
    >
    > I tried adding an <a href=...> encapsulating the button, but it didnt

    work.
    >
    > Any suggestions?
    >
    > --
    > _____________________________
    > Ron Rodenberg
    > Lead Software Engineer
    > Razorvision Technology, Inc.
    > (214) 207-1688
    >
    >
     
    vMike, Aug 9, 2003
    #2
    1. Advertising

  3. Temp

    Kathy Burke Guest

    Try adding this in your page init:

    btnName.Attributes.Add("onclick", "pop_window();return false;")

    and put your script for it in the html <head>, for example:

    <script language="javascript">
    function pop_window()
    {
    var confirmWin = null;
    confirmWin = window.open('Scanned.aspx', 'WindowName',
    'width=300,height=400,left=200,top=200,toolbar=no,resizable=no,menubar=n
    o');
    }
    </script>

    hope this helps.

    Kathy

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Kathy Burke, Aug 10, 2003
    #3
  4. Temp

    Natty Gur Guest

    in adition to Kathys replay,

    If you'r using ASP:Button add :
    window.event.returnValue = false;
    window.event.cancelBubble = true;

    to prevent postback.

    Natty Gur, CTO
    Dao2Com Ltd.
    34th Elkalay st. Raanana
    Israel , 43000
    Phone Numbers:
    Office: +972-(0)9-7740261
    Fax: +972-(0)9-7740261
    Mobile: +972-(0)58-888377


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Natty Gur, Aug 10, 2003
    #4
  5. Temp

    Kathy Burke Guest

    Nat, where does this go exactly?

    window.event.returnValue = false;
    window.event.cancelBubble = true;

    Thanks,

    Kathy

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Kathy Burke, Aug 10, 2003
    #5
  6. Temp

    Natty Gur Guest

    Kathy Hi,

    usually in pop_window function. but i didnt see the "return false;"
    sorry :-( .

    Natty Gur, CTO
    Dao2Com Ltd.
    34th Elkalay st. Raanana
    Israel , 43000
    Phone Numbers:
    Office: +972-(0)9-7740261
    Fax: +972-(0)9-7740261
    Mobile: +972-(0)58-888377


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Natty Gur, Aug 11, 2003
    #6
    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. dapkniht
    Replies:
    1
    Views:
    1,337
    Eliyahu Goldin
    Mar 8, 2006
  2. XyZaa
    Replies:
    0
    Views:
    573
    XyZaa
    Jul 19, 2007
  3. samppi
    Replies:
    27
    Views:
    492
    David A. Black
    Dec 5, 2007
  4. Jens Peter Hansen
    Replies:
    7
    Views:
    543
    Randy Webb
    Jun 19, 2004
  5. Raffi
    Replies:
    4
    Views:
    225
    Dr John Stockton
    Aug 12, 2004
Loading...

Share This Page