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

Urgent...trapping User's Browser closing event....

P: n/a
hello all,

I am developing the web application using ASP.net and VS.2003 IDE.

here is the situation which i want to implement.

1) User is browsing some webform. I want to trap this event. this i am doing
with Session_Onstart.
2) Now when user is exiting i.e. closing the browser window i want to trap
this event and perform some operation. I tried using Session_OnEnd event,but
this event will get generated when time out of the session occurs or when
the session is abandon by the application. hence it is not serving my
purpose.

can any body help me in trapping the user's browser closing event or with
any other options??

thanks in advance

regards
chirag
Nov 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Chirag,

You will need to handle that on the client, not in your server-side ASP.NET
code. ASP.NET operates over HTTP, and HTTP is a connectionless protocol.
Your ASP.NET application has no knowledge whatever of the client machine.
Client-side events such as the browser window closing cannot be handled on
the server.

I'm not aware of a client-side event that will handle the closing of the
browser window, but there may be some in the group who are better versed on
client side code than I am. I don't deal much with client side code in my
position.

Jim Cheshire [MSFT]
Developer Support
ASP.NET
ja******@online.microsoft.com

This post is provided as-is with no warranties and confers no rights.
--------------------
From: "Chirag Malvi" <ch**********@in.bosch.com>
Newsgroups: microsoft.public.dotnet.framework.aspnet
Subject: Urgent...trapping User's Browser closing event....
Date: Tue, 11 Nov 2003 19:04:50 +0530
Organization: RBIN
Lines: 23
Sender: UN*****@173.148.9.199
Message-ID: <bo**********@ns2.fe.internet.bosch.com>
NNTP-Posting-Host: 173.148.9.199
X-Trace: ns2.fe.internet.bosch.com 1068557695 9853 173.148.9.199 (11 Nov 2003 13:34:55 GMT)X-Complaints-To: us****@internet.bosch.com
NNTP-Posting-Date: 11 Nov 2003 13:34:55 GMT
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MSMail-Priority: Normal
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!news-out.cwix.com!newsfeed.cwix.co
m!newsfeed.icl.net!newsfeed.fjserv.net!feed.news.n acamar.de!news.f.de.plusli
ne.net!news-fra1.dfn.de!news0.de.colt.net!news1.boschrexroth.d e!news1.fe.int
ernet.bosch.com!not-for-mailXref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:190011
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

hello all,

I am developing the web application using ASP.net and VS.2003 IDE.

here is the situation which i want to implement.

1) User is browsing some webform. I want to trap this event. this i am doingwith Session_Onstart.
2) Now when user is exiting i.e. closing the browser window i want to trap
this event and perform some operation. I tried using Session_OnEnd event,butthis event will get generated when time out of the session occurs or when
the session is abandon by the application. hence it is not serving my
purpose.

can any body help me in trapping the user's browser closing event or with
any other options??

thanks in advance

regards
chirag


Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.