Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi, after running through my processing, i need a click of the "Close" button to exit the whole program, and close the browser....Any ideas?

 

Cheers

 

Axum

Posted

Just a comment:

 

I never see any web application will "Close" the browser. Maybe because browser is not part of the program actually, so we should not close the browser, except there is a sub window...

 

For example: you login Yahoo mail and check your mail, after logoff, you expect Yahoo to close the browser for you? How if user want to use this browser for other thing?

Posted

eh? well the user can't use the browser for anything else!! that's a decision, i as the programmer, has made!

 

You CAN close it by just adding this to the OnClick event :

 

Response.Write("<script>window.close();</script>");

 

but then IE comes up with with a Yes/No confirmation message, anyone know if you can just close it without this confirmation?

 

Axum

  • *Gurus*
Posted
It is in no way proper to close a browser window unless it was opened by a web page as an auxiliary window. Either open an auxiliary window and close that, or deal with the all-too-appropriate security that's built into browsers. The fact that the user has your web page loaded doesn't give that page any right to control the browser it's being displayed in.
Posted

it does in an internal secure intranet environment surely?

 

and yes, it is opened by another browser...

 

but i take it there is NO way of getting round this YES/NO dialog box...?

 

Axum

Posted

many thanks mate, can't believe it's as simple as that one line :)

 

Ah well, gotta know your javascript i guess!

 

Axum

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...