Because of the disconnected nature of the internet its not possible to know
when the client closes their browser or leaves the page. If you are running
an intensive block of code and want to check whether the client is still
there you can use Response.IsClientConnected to check whether they are still
connected.
ex. If Response.IsClientConnected = True Then
End If