473,386 Members | 1,726 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.

How to close the browser down ?

Good evening all.
I know how to close the browser down when there is no
frames involved.
I have a frameset aspx page. It has 3 frames, left, main
and bottom.
In the left frame I have a exit button. I want the user
to be able to click on it and then the browser closes.

Anyone know how this can be done?
Also is there anyway other then using java code to kill
the browser on a button click?

Thanks
Deasun
Nov 17 '05 #1
5 4871
Try this javascript:
parent.window.close();

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
"Deasun" <ti*****@mail.com> wrote in message
news:09****************************@phx.gbl...
Good evening all.
I know how to close the browser down when there is no
frames involved.
I have a frameset aspx page. It has 3 frames, left, main
and bottom.
In the left frame I have a exit button. I want the user
to be able to click on it and then the browser closes.

Anyone know how this can be done?
Also is there anyway other then using java code to kill
the browser on a button click?

Thanks
Deasun

Nov 17 '05 #2
You may need to do this (slight modification because the parent was not
opened by another window):

parent.opener = parent;
parent.close();
--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big things are made up of
lots of little things.

"Steve C. Orr, MCSD" <St***@Orr.net> wrote in message
news:u0**************@TK2MSFTNGP10.phx.gbl...
Try this javascript:
parent.window.close();

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
"Deasun" <ti*****@mail.com> wrote in message
news:09****************************@phx.gbl...
Good evening all.
I know how to close the browser down when there is no
frames involved.
I have a frameset aspx page. It has 3 frames, left, main
and bottom.
In the left frame I have a exit button. I want the user
to be able to click on it and then the browser closes.

Anyone know how this can be done?
Also is there anyway other then using java code to kill
the browser on a button click?

Thanks
Deasun


Nov 17 '05 #3


Thanks for the help. I put the following under my btn click event:
Response.Write("<script>parent.opener =
parent;parent.close();</script>")

Didn't work. Tried your first example too. No help.
Any other ideas ?

Thanks

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #4
Using Response.Write is dodgy at best. Try defining the script as a string,
and using RegisterStartupScript() to add it to the page. Also, which page
are you adding this to? It would have to be a page in a frame, not the
frameset itself.
--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big things are made up of
lots of little things.

"Deasun O'Donnachadha" <ti*****@mail.com> wrote in message
news:ed**************@TK2MSFTNGP12.phx.gbl...


Thanks for the help. I put the following under my btn click event:
Response.Write("<script>parent.opener =
parent;parent.close();</script>")

Didn't work. Tried your first example too. No help.
Any other ideas ?

Thanks

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 17 '05 #5
Well tried that I did.
Didn't work. Here is what I have;
Note! I tried the following in both Page_Load and Page_Init

Dim scriptString As String = "<script>parent.opener" scriptString =
scriptString & "parent;parent.close"
scriptString = scriptString & "();</script>"
If (Not Me.IsStartupScriptRegistered("Do_CloseApp")) Then
Me.RegisterStartupScript("Do_CloseApp", scriptString)
End If

And under the btn click:
Response.Write("<script>Do_CloseApp();</script>")

That i am not sure is correct. Please let me know if that is the correct
way to call the script.

What did it do:
The browser appears and then disappears by itself. No error msgs.

Thanks for the help with this.
Deasun

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #6

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

Similar topics

9
by: Graham | last post by:
What I currently have is a page that opens another browser at 800x600, once that is loaded I would like to close the orginal page down while keeping the page that it has just opened open (To make...
3
by: Gene Brumm | last post by:
I have an ASP.NET web application that checks for a database in Page_Load(). If the database is not present I want to exit the application. I have tried using window.close() which does close the...
10
by: Shang Wenbin | last post by:
Hi, When I want to close the current window using window.close() in IE6.0, there will be a confirm box that: The web page you are viewing is trying to close the window. Do you want to close this...
18
by: Roger Withnell | last post by:
I open a new window from the current window to display maps. Several maps of different sizes can be displayed. The function is given the size of the map and adjusts the window size accordingly....
1
by: bloodandrose | last post by:
Can you help me How to detect browser close event? Thanks
10
by: morangolds | last post by:
Hi, I've been having a problem with C++ Windows Forms apps not "ending" when you close the form window. I've searched about this problem all over the place and most searches have lead me to...
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,...
4
by: =?Utf-8?B?SmVycnkgQw==?= | last post by:
I have seen several articles about this subject but I was wondering with ajax is this easer. The articles mentioned client callback and the onbeforeunload event of the browser. Can AJAX be used for...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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.