window.close not working in page

Discussion in 'ASP .Net' started by David C, Sep 25, 2009.

  1. David C

    David C Guest

    I have an aspx page that I am opening as a pop-up from another aspx page via
    javascript window.open(.....). In the page that is opened, I have code to
    populate some info and then print the page. I want it to close after
    printing so I have the following javascript after the end of the form block.

    window.print();

    window.opener = 'viahome';

    window.close();


    What am I missing? Thanks.

    David
    David C, Sep 25, 2009
    #1
    1. Advertising

  2. David C

    David C Guest

    Nevermind. I put both print and close into Body O=onload event and it
    works.

    David
    "David C" <> wrote in message
    news:...
    >I have an aspx page that I am opening as a pop-up from another aspx page
    >via javascript window.open(.....). In the page that is opened, I have code
    >to populate some info and then print the page. I want it to close after
    >printing so I have the following javascript after the end of the form
    >block.
    >
    > window.print();
    >
    > window.opener = 'viahome';
    >
    > window.close();
    >
    >
    > What am I missing? Thanks.
    >
    > David
    >
    David C, Sep 25, 2009
    #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?UGF1bA==?=

    not sure why close window function not working

    =?Utf-8?B?UGF1bA==?=, Nov 23, 2004, in forum: ASP .Net
    Replies:
    14
    Views:
    1,169
    =?Utf-8?B?UGF1bA==?=
    Nov 29, 2004
  2. Replies:
    6
    Views:
    8,831
    sateeshranga
    Aug 7, 2008
  3. Iñaki Baz Castillo
    Replies:
    7
    Views:
    845
    Iñaki Baz Castillo
    Jan 12, 2010
  4. Walter Beierdonck

    Self.close() window without the dialog close?Yes/NO

    Walter Beierdonck, Apr 29, 2004, in forum: Javascript
    Replies:
    1
    Views:
    343
    Grant Wagner
    Apr 30, 2004
  5. Shang Wenbin

    close current window using window.close()

    Shang Wenbin, Sep 1, 2005, in forum: Javascript
    Replies:
    10
    Views:
    369
    Gérard Talbot
    Sep 2, 2005
Loading...

Share This Page