Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to close the browser down ?

Reply
Thread Tools

How to close the browser down ?

 
 
Deasun
Guest
Posts: n/a
 
      07-21-2003
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
 
Reply With Quote
 
 
 
 
Steve C. Orr, MCSD
Guest
Posts: n/a
 
      07-21-2003
Try this javascript:
parent.window.close();

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net


"Deasun" <(E-Mail Removed)> wrote in message
news:09d701c34fc5$112b0710$(E-Mail Removed)...
> 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



 
Reply With Quote
 
 
 
 
Kevin Spencer
Guest
Posts: n/a
 
      07-21-2003
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Try this javascript:
> parent.window.close();
>
> --
> I hope this helps,
> Steve C. Orr, MCSD
> http://Steve.Orr.net
>
>
> "Deasun" <(E-Mail Removed)> wrote in message
> news:09d701c34fc5$112b0710$(E-Mail Removed)...
> > 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

>
>



 
Reply With Quote
 
Deasun O'Donnachadha
Guest
Posts: n/a
 
      07-22-2003


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!
 
Reply With Quote
 
Kevin Spencer
Guest
Posts: n/a
 
      07-22-2003
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
>
> 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!



 
Reply With Quote
 
Deasun O'Donnachadha
Guest
Posts: n/a
 
      07-23-2003
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!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to close a TCP socket? (TCPSocket#close doesn't close it) IƱaki Baz Castillo Ruby 7 01-12-2010 01:32 PM
Browser close event (MSIE and FF): how to detect browser close ? pamelafluente@libero.it Javascript 0 01-23-2007 12:44 AM
browser/applet hanging on close-down - how to debug Ed Java 8 05-31-2004 03:57 PM
JavaMail POP3 folder.close() method close also store! Daniel Albisser Java 1 04-07-2004 03:45 PM
How to close child browser while parent close? Denon ASP .Net 1 11-14-2003 08:14 AM



Advertisments