By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,509 Members | 1,307 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,509 IT Pros & Developers. It's quick & easy.

How to trap browser close event in SERVER side?

P: n/a
How to trap browser close event in SERVER side?
I read a lot of forum message, it talk about onclose(), onunload() and even
onbeforeunload() event. However, all of theses are based on javascript
written on the client browser , like IE. To send a POST to web server to
acknowledge its close event.

However, I just think, web server and client browser is a TCP connection.
And if the client browser is close and it imply the TCP socket is broken.
The web should detect the connection lost, Right? Is there any method that
the web server(server side) can detect this?

I'm cope for ASP.NET solution with IE browser as majority.

Thanks for any help

Den
Nov 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
> However, I just think, web server and client browser is a TCP connection.
And if the client browser is close and it imply the TCP socket is broken.
The web should detect the connection lost, Right? Is there any method that
the web server(server side) can detect this?
HTTP is stateless. There is no persistent connection between browser and
server. Therefore, no, there is no method to do what you want.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.

"Denon" <de****@icqmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl... How to trap browser close event in SERVER side?
I read a lot of forum message, it talk about onclose(), onunload() and even onbeforeunload() event. However, all of theses are based on javascript
written on the client browser , like IE. To send a POST to web server to
acknowledge its close event.

However, I just think, web server and client browser is a TCP connection.
And if the client browser is close and it imply the TCP socket is broken.
The web should detect the connection lost, Right? Is there any method that
the web server(server side) can detect this?

I'm cope for ASP.NET solution with IE browser as majority.

Thanks for any help

Den

Nov 17 '05 #2

P: n/a
You can use the IsClientConnected property of the Response object.
It can be useful to check for user still connected for "heavy" tasks to
complete.

Luca

"Denon" <de****@icqmail.com> wrote in message
news:#K**************@TK2MSFTNGP12.phx.gbl...
How to trap browser close event in SERVER side?
I read a lot of forum message, it talk about onclose(), onunload() and even onbeforeunload() event. However, all of theses are based on javascript
written on the client browser , like IE. To send a POST to web server to
acknowledge its close event.

However, I just think, web server and client browser is a TCP connection.
And if the client browser is close and it imply the TCP socket is broken.
The web should detect the connection lost, Right? Is there any method that
the web server(server side) can detect this?

I'm cope for ASP.NET solution with IE browser as majority.

Thanks for any help

Den

Nov 17 '05 #3

P: n/a

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:%2********************@TK2MSFTNGP10.phx.gbl.. .
However, I just think, web server and client browser is a TCP connection. And if the client browser is close and it imply the TCP socket is broken. The web should detect the connection lost, Right? Is there any method that the web server(server side) can detect this?


HTTP is stateless. There is no persistent connection between browser and
server. Therefore, no, there is no method to do what you want.


Could you not use Javascript to catch the browser window close event to
launch another page that would inform the server?
Nov 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.