473,320 Members | 2,003 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to trap browser close event in SERVER side?

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
3 11194
> 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
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

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: david | last post by:
(1) How do I update the IE browser's status bar from within an ASP.NET web application? (2) How can I capture the event of closing the IE browser from within an ASP.NET web application? (3)...
1
by: feng | last post by:
Hi, When user closes a browser window by clicking on the "X" button, I want the server to be noticed (either through postback or calling other ASP pages, etc.) and perform some task...
3
by: Lord2702 | last post by:
Sat. Oct. 30, 2004 3:25 PM PT I want to detect, if user has close the browser, (after logging to my site), that user has closed the browser. How to achieve it ? I want to know this close action...
5
by: news.microsoft.com | last post by:
Hi everyone, I need some help (may be in the form of some sample code) for the subject question. I have an ASP.NET/C# application. I need to do quite a few tasks when the session ends. I...
4
by: Bill Manring | last post by:
I need to capture the event when the user closes the browser in my application. I have some code in the session_End event, which works fine when the session times out, but I need to end the...
9
by: WRH | last post by:
Hello I am new to asp but I made some Jscript functions which work fine. The functions contain some strings used as a registration key for some apps. It is important that these strings not be...
2
by: David McDivitt | last post by:
Another fellow here must modify an application. On the web page, pressing the enter key causes the form to submit. What users want is to remove enter key functionality from within a textarea and...
3
by: Gouri.Mahajan7 | last post by:
Hello, I am new to asp.net. Can anybody please tell me which event is fired when we close the browser. I want to remove some resources when the browser close button is pressed. Thanks in advance....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.