Click here to Skip to main content
16,018,650 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to know that when clients internet connection not work or hiw browser closed ?
because i want create automatic logout or any other function run when his broser close or internet connection not work
Posted

1 solution

Both the events you want to code for is undetectable in the server side. Though there are client side events like window.unload there is practically no reliable way you can code for this.As a close alternative in ASP.Net you can write the code in Session_End event in the Global.asax file which will fire incase of every session expiry, but remember session_end event executes when when user session expires in server and not in case of browser close or internet disconnection.
 
Share this answer
 
Comments
rahulideasetter 17-Oct-12 1:49am    
so if i create a chatting application any my client doing chatting but suddenly its internet connection disconnect so i want show him a message "please check your internet connection".

please tell me first about php in asp.net i know this 4 events session start,session end,application start & application ened event

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