Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to trap browser close event in SERVER side?

Reply
Thread Tools

How to trap browser close event in SERVER side?

 
 
Denon
Guest
Posts: n/a
 
      11-07-2003
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


 
Reply With Quote
 
 
 
 
Kevin Spencer
Guest
Posts: n/a
 
      11-07-2003
> 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" <> wrote in message
news:%23K7hr$...
> 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
>
>



 
Reply With Quote
 
 
 
 
Luca Bertoldi
Guest
Posts: n/a
 
      11-07-2003
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" <> wrote in message
news:#K7hr$...
> 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
>
>



 
Reply With Quote
 
Ed Crowley
Guest
Posts: n/a
 
      11-07-2003

"Kevin Spencer" <> wrote in message
news:%23%23%.. .
> > 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?


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to close a TCP socket? (TCPSocket#close doesn't close it) IƱaki Baz Castillo Ruby 7 01-12-2010 01:32 PM
Browser close event (MSIE and FF): how to detect browser close ? pamelafluente@libero.it Javascript 0 01-23-2007 12:44 AM
How to trap the click event of the browser window's "x" button? =?Utf-8?B?RmVuZw==?= ASP .Net 1 10-28-2005 10:48 PM
What is the difference between SysLog Server and Trap server?. santa19992000@yahoo.com Cisco 14 02-21-2005 07:15 PM
How to close child browser while parent close? Denon ASP .Net 1 11-14-2003 08:14 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57