473,671 Members | 2,326 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Browser Close Event

which event is fired when a browser is closed.
i want to call asp page which deleet some files on the server.
i tired using onunload event but it aslo get fired when a page is refreshed.
the thing should work in netsacpe also.
please advise me .
regds,
Navin Mahindroo
Jul 19 '05 #1
1 4693
Hello Navin,

You can try to do it with the global.asa file in your web
project. Use one of the

Application_OnS tart
This event occurs when the FIRST user calls the first
page. This event occurs after the Web server is restarted
or after the Global.asa file is edited.
The "Session_OnStar t" event occurs immediately after this
event.

Session_OnStart
This event occurs EVERY time a NEW user requests his or
hers first page in the ASP application.

Session_OnEnd
This event occurs EVERY time a user ends a session. A user
ends a session after a page has not been requested by the
user for a specified time (by default this is 20 minutes).

Application_OnE nd
This event occurs after the LAST user has ended the
session. Typically, this event occurs when a Web server
stops. This procedure is used to clean up settings after
the Application stops, like delete records or write
information to text files.

Restrictions:
- You can not display text that is written in the
Global.asa file. This file can't display information.
- You can only use Server and Application objects in the
Application_OnS tart and Application_OnE nd subroutines. In
the Session_OnEnd subroutine, you can use Server,
Application, and Session objects. In the Session_OnStart
subroutine you can use any built-in object
Best regards,
Karim

-----Original Message-----
which event is fired when a browser is closed.
i want to call asp page which deleet some files on the server.i tired using onunload event but it aslo get fired when a page is refreshed.the thing should work in netsacpe also.
please advise me .
regds,
Navin Mahindroo
.

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
3438
by: hawkon | last post by:
Hi all, I have an important question to ask about how to trap events when the user close the browser window. I'm a ASP programmer and I have s MSSQL database with a user table where I'm able to track if the user is logged in or not. However this is not easy to track if the user close the browserwindow without using the logout button. I have tried putting in code in Session_onend, but it doesn't seem to run if the browser is closed. Eg....
1
8108
by: Matt | last post by:
When we refresh the page (F5, or icon in browser), it will first trigger ONUNLOAD event and then trigger ONLOAD event. When we close the browser (X on right top icon), it will trigger ONUNLOAD event. Now when ONUNLOAD event is triggered, there is no way to distinguish between refresh the page or close the browser. Here's the code fragment. The logic in window_unload() only applies to
3
2089
by: Bond | last post by:
how do I know when the browser is making a request to the server? I am not having an onclick event for EVERY hyperlink, submit, etc. There must be some javascript function that I can overwrite that will allow me to do something when the browser requests something from the server. My plan is whenever a browser is about to request something from the server to create a time stamp and then compare this time to the time when the page...
3
11217
by: Denon | last post by:
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...
3
5870
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 Intranet site. The code makes a call to a third-party component (think of it as a lock) when the page loads. Now the OK and Cancel server buttons I can handle and use to release the lock as required. But previously in classic ASP I had been trapping the user hitting the close 'x' button by...
4
4809
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 session immediately when the user closes the browser. Does anyone know a way of doing this? -- Thanks,
6
3934
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 click close button in browser, I can send a signal to server. This seems to be achievable with body unload events, but it is little too much, as even if user navigate within my site, this event will be generated, this can be avoided by handling onclick of each link, so that I'll know exactly...
1
6785
by: baburk | last post by:
Hi, I wants to capture browser tab close event? I got for window close event. if((window.event.clientX<0) || (window.event.clientY<0)) { }
3
2949
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. Regards, Gouri.
0
8472
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8390
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8909
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8596
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6222
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4221
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2806
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2048
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1801
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.