Close the browser

Discussion in 'ASP .Net' started by Randy, Mar 29, 2005.

  1. Randy

    Randy Guest

    Hello,
    I'm trying to find a way to close the browser with out the IE security
    message "The Web page you are viewing is trying to close the window."
    message. I know how to close the browser using Javascript (window.close())
    but I would not like to get this message.
    Is there a way to close it in C#?

    Thanks
     
    Randy, Mar 29, 2005
    #1
    1. Advertising

  2. Randy

    darrel Guest

    > I'm trying to find a way to close the browser with out the IE security
    > message "The Web page you are viewing is trying to close the window."
    > message. I know how to close the browser using Javascript (window.close())
    > but I would not like to get this message.
    > Is there a way to close it in C#?


    Controlling the browser is a client-side behavior, so you have to use
    javascript. And whether or not you get those types of errors is entirely
    dependant on the browser. Typically, you can close any window you open, but
    not ones that the user has opened themselves.

    -Darrel
     
    darrel, Mar 29, 2005
    #2
    1. Advertising

  3. Randy

    Matt Berther Guest

    Hello Randy,

    Prior to calling window.close, set window.opener to a non-null value. Ex:

    window.opener = this;
    window.close();

    --
    Matt Berther
    http://www.mattberther.com

    > Hello,
    > I'm trying to find a way to close the browser with out the IE security
    > message "The Web page you are viewing is trying to close the window."
    > message. I know how to close the browser using Javascript
    > (window.close())
    > but I would not like to get this message.
    > Is there a way to close it in C#?
    > Thanks
    >
     
    Matt Berther, Mar 29, 2005
    #3
  4. Randy

    Bruce Barker Guest

    though hopefully, IE will fix this security bug someday.

    -- bruce (sqlwork.com)

    "Matt Berther" <> wrote in message
    news:...
    > Hello Randy,
    >
    > Prior to calling window.close, set window.opener to a non-null value. Ex:
    >
    > window.opener = this;
    > window.close();
    >
    > --
    > Matt Berther
    > http://www.mattberther.com
    >
    >> Hello,
    >> I'm trying to find a way to close the browser with out the IE security
    >> message "The Web page you are viewing is trying to close the window."
    >> message. I know how to close the browser using Javascript
    >> (window.close())
    >> but I would not like to get this message.
    >> Is there a way to close it in C#?
    >> Thanks
    >>

    >
    >
    >
     
    Bruce Barker, Mar 29, 2005
    #4
  5. Randy

    Randy Guest

    Thanks for all the help everyone. That was just the ticket Matt...thanks a
    bunch!


    "Randy" <> wrote in message
    news:...
    > Hello,
    > I'm trying to find a way to close the browser with out the IE security
    > message "The Web page you are viewing is trying to close the window."
    > message. I know how to close the browser using Javascript (window.close())
    > but I would not like to get this message.
    > Is there a way to close it in C#?
    >
    > Thanks
    >
     
    Randy, Mar 29, 2005
    #5
  6. Randy

    Matt Berther Guest


    > though hopefully, IE will fix this security bug someday.


    :)
     
    Matt Berther, Mar 29, 2005
    #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. Denon
    Replies:
    1
    Views:
    598
    Saravana [MVP]
    Nov 14, 2003
  2. Daniel Albisser
    Replies:
    1
    Views:
    1,151
    GaryM
    Apr 7, 2004
  3. Paul van Rossem
    Replies:
    0
    Views:
    621
    Paul van Rossem
    Apr 7, 2005
  4. Iñaki Baz Castillo
    Replies:
    7
    Views:
    940
    Iñaki Baz Castillo
    Jan 12, 2010
  5. Replies:
    0
    Views:
    546
Loading...

Share This Page