473,796 Members | 2,558 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to detect the page has refreshed??

When the page is refresh, it will first call window_unload() and
then call window_load(). The problem is I window_unload() is
invoked when the user click close button, or right top icon close
button. I don't want refresh will call window_unload. Any ideas?
thanks!!

function window_load()
{//etc..
}

function window_unload()
{//etc..
}

<BODY ONLOAD="window_ load()" ONUNLOAD="windo w_unload()">
Jul 23 '05 #1
1 2617
Matt wrote:
When the page is refresh, it will first call window_unload()
and then call window_load(). The problem is I window_unload() is
invoked when the user click close button, or right top icon
close button. I don't want refresh will call window_unload. Any
ideas? thanks!!

<snip>

You have neglected to say why you want to do this.

The unload event is called whenever a page is unloaded for any reason
(except on the browsers that do not bother to call it when the browser
is closed). The only way of attributing a reason for the unload is when
it is the direct result of an action initiated within the document
(navigation, form submission). However, there is an extensive list of
user actions that will result in a page unloading, including closing
down the browser and refreshing the page, and no way of knowing which of
them applies to any given unload.

Almost any design that called for an interest in the distinction between
refreshing a page and closing a browser window would be unsuitable for
use over HTTP (as it is a stateless protocol).

Richard.
Jul 23 '05 #2

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

Similar topics

0
1254
by: Alfons Puig | last post by:
I have a container page with 3 frames (Header, left frame and right frame) In the right frame I load an aspx page having a boounded datagrid with some column templates having a DopDownList in the column header in order to select some values to be displayed in the grid. It works perfectly. This page is refreshed every n seconds (using http-equiv refresh or Response.AppendHeader("Refresh",n)). It works perfectly. But if I open one of the...
1
2023
by: abdul bari | last post by:
Hi I have a standard html form which is generated by an XSL sheet. The form data is submitted to the server and is passed on to file.aspx for processing. However file.aspx is refreshed every 5 seconds, when this happens the form data is lost, is there anyway whereby when the page is refreshed the form data remains. I thought with ASP.NET all data is maintained- so a refresh will still maintain the form data. The form data is obtained...
10
2211
by: Nathan Sokalski | last post by:
One thing that I have often needed to do that I have been unable to find a way to do is refresh the page (basically do the same thing as pressing the browser's Refresh button). I know how to do this using Javascript/JScript, but I have situations in which I need it to be done immediately after code that is part of my other code. Is there any way to do this? Thanks. -- Nathan Sokalski njsokalski@hotmail.com http://www.nathansokalski.com/
5
1479
by: J-T | last post by:
Is there a way to detect if a user has refreshed a page in asp.net? Thanks a lot
4
1862
by: SSS | last post by:
Hello there, My problem is that I have a page which is displaying 4 real time data values which are being refreshed every one minute. On the same page I have other text boxes where user enters some data. The page is being refreshed through code using META tag. When page is refreshed, the data entered is lost. How do I maintain the data? We tried to use viewstate, but since the page is autorefresh, we cannot store the viewstate values in...
0
1833
by: arunprabu | last post by:
Hi, I have a problecm with the AJAX request in my webpage. I have some filters on top of the page. I have a submit button and an empty div below the filters. Some of the filters have ajax requests to update the content within the filters. For example, I have 2 drop downs, one for state and another for country. When I select a country in the country drop down, an ajax request is sent to fetch appropriate list of states and updates the
1
4369
by: JimO | last post by:
I'm trying to write an ASP interface that mimiks a .Net datagrid control. I'm having a problem when I'm in the middle of an Edit, Update, or a New Record. If the user hits the wrong button, the program grabs the values in the textboxes using the request.form() and then redisplays them in the textboxes when the records table gets written back out to the page. This works fine as long as the form is submitted. If it's just a page refresh...
3
1112
by: Mythilisg | last post by:
hi, i'm working in asp.net with c#. i hav one dropdownlist with some options which is similar to Security Questions in yahoo mail. I hav one option called "If Others". When the user selects this option, one label and textbox will become visible on the form to type for the user. But the problem is when the user chooses the option "If Others", the page gets refreshed. But i dont want the page to get refreshed. can any one tell me what i need...
1
3234
by: jim bradshaw | last post by:
I have an asp.net page that calls itself recursively if the user selects certain actions on form buttons. The page will be changed in various ways according to the action called for by the user. This works fine, except for the fact that the "action" variable is a hidden field and if the user hits the refresh button or navigates to the page by the "back" button or other methods, the latest "action" will be performed again. Does anyone out there...
0
9680
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
10230
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10174
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,...
0
10012
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7548
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
5442
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...
0
5575
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4118
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
3731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.