473,386 Members | 1,721 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Close the browser

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
Nov 19 '05 #1
5 3148
> 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
Nov 19 '05 #2
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


Nov 19 '05 #3
though hopefully, IE will fix this security bug someday.

-- bruce (sqlwork.com)

"Matt Berther" <mb******@hotmail.com> wrote in message
news:22***************************@news.microsoft. com...
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


Nov 19 '05 #4
Thanks for all the help everyone. That was just the ticket Matt...thanks a
bunch!
"Randy" <te**@temp.com> wrote in message
news:OY*************@TK2MSFTNGP15.phx.gbl...
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

Nov 19 '05 #5
though hopefully, IE will fix this security bug someday.


:)

Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Pack Fan | last post by:
I've noticed that session variables will persist on Mac IE even after all browser windows have been closed. One must quit the program to clear the session variables. This presents a security risk...
6
by: chon | last post by:
I have an ASP page that is sent a file location as a parameter. It opens this file, loads the ADODB.Stream object and does a binary write to the page forcing the download dialog to appear. This...
3
by: Denon | last post by:
How to trap browser close event in SERVER side? I read a lot of forum message, it talk about onclose(), onunload() and even onbeforeunload() event. However, all of theses are based on javascript...
3
by: Gin Lye | last post by:
Does any one know to close the web browser automatically after logging off Your help will be appreciated gin lye
4
by: Ron Lautmann | last post by:
I want to close a browser window so I created a Close button that does this: private void Button1_Click(object sender, System.EventArgs e) {...
7
by: Paul | last post by:
Hi I have a web application that has a log off selection, just redirects the browser to a form with a label displaying you are loging off. In part of the application I open a new window and was...
37
by: Jan Tovgaard | last post by:
Hey everyone:) We have a critical problem, which I can see that other people also has ran into. In Internet Explorer 7 it is no longer possible to do a window.close after opening a window,...
7
by: Toccoa | last post by:
After considerable googling - I mean searching with Google(r) - I could not find javascript on a button or <a href=... to close a window in the latest versions of IE and FireFox. There seemed...
5
by: jimmy | last post by:
Hi all, I want to capture the event when the browser's close button is clicked in an html page. I tried using the event.ClientX and event.ClientY property in the body unload event, and this...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.