472,353 Members | 1,885 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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

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

Similar topics

2
by: Asit | last post by:
How can i know when user clicks X button of the browser ? I have to write some code when user clicks X button of browser. What is the event for...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being...
2
by: Paul Steele | last post by:
Some time ago I tracked down the code for detecting the shutdown event within a C# program. I tested it, it worked, and I moved on. However, I just...
3
by: =B= | last post by:
Hi all, I was wondering if anyone has had any luck with trapping the <BODY> onUnload() event in ASP.NET? The thing is, I'm writing code for an...
3
by: Jason Chu | last post by:
I've written a file uploading part of my application using the IHttpModule. So now, I don't have the memory problem of uploading something big. ...
4
by: RSH | last post by:
I am trying to figure out how I can trap the Closing Event that occurs when a user attempts to close the window by clicking on the red"X". I...
6
by: hemant.singh | last post by:
Hi all, I am trying to get a way by which I'll know exactly when user goes out of my site by clicking on close button in browser, So that w/e user...
2
by: feltra | last post by:
Hi, The following is from my friend, who has some technical problem at present in accessing the web... I am writing for him... Kindly request...
19
by: zacks | last post by:
I have a .NET 2.0 MDI application where the child form has a Tab Control. Each of the Tab in the Tab Control has a Validating event to handle what...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

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.