Click here to Skip to main content
16,017,261 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to close the browser after a button click?
Posted
Updated 14-Sep-10 23:41pm
v2

Using Javascript.
For HTML input control use onclick event or OnClientClick for server Button control. Call window.close();
 
Share this answer
 
Comments
aayu 15-Sep-10 5:50am    
good ans sandeep
aayu 15-Sep-10 5:51am    
Just as an FYI... the user will probably get a popup warning about the window closing... this is standard behavior.
What most people will do is give a "logout" button instead, that flushes the session info, abandons it and then redirects away.
Dalek Dave 15-Sep-10 6:03am    
Just what I was going to tell him, but you beat me to it.
Please see (if I got you) the article "How to use Visual C# to close another application"[^].
:)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900