Click here to Skip to main content
15,890,995 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

if i click the submit button the browser(www.google.com) is open this browser is open only 30 minutes after automatically close the browser so the start time(ex:11.00)and end time (ex:12.00) store my database

What my requirments is how check the condition after 30 mintes close the browser using asp.net with c#.ne wepapplication.
Posted

Really, you need to do this in Javascript - AFAIK there is no way to do this from the server (there is no guarantee that you app is even running thirty minutes later).
And, I suspect that whatever you, it won't work in all browsers - IIRC Firefox won't let Javascript close teh browser window without user intervention.

Doing it in Javascript is easy:
http://www.java-scripts.net/javascripts/Auto-Browser-Closer.phtml[^]
 
Share this answer
 
try this
in .aspx page
body tag
onLoad="setTimeout(window.close, 30000);"

or



window.setTimeout( window.close, 30000 );
 
Share this answer
 
Comments
Member 8614787 24-Feb-12 4:31am    
hi thanks for your reply i use above codes but can't close the browser(www.google.com) still is there only

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