473,465 Members | 1,925 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Differentiate between a page unload and a page refresh.

1 New Member
Hi Guys,

Have been looking at this for a while and not sure if there is a solution but hopefully someone can point me in the right direction:

The problem is essential I want to undo an update if the user unloads a page but not if they just refresh the page.

Detail:
I have 2 asp pages.
Page 1 solicits some information and updates the database. This information is then posted to Page 2, where further details are entered and a final update is done. If however the user does not confirm the update on Page 2 and unloads the page I undo all updates by calling a function in the OnUnLoad event. This works fine but the problem is this function is also called if the user just does a Refresh on page 2.

In Summary:
Page 1, enter information,
Submit and Update the Database
Post details to Page 2
Enter more information on Page 2 and complete the update.
If Page 2 is unloaded OnUnLoad function is called and all updates are cancelled.
Problem: If Page 2 is refreshed, the the OnUnLoad event is also called and updates are also cancelled.

Any help would be appreciated.

Thanks.
Jul 26 '07 #1
1 2374
shweta123
692 Recognized Expert Contributor
Hi,

Is there any specific need for updating partial information on page1? Instead, you can pass all the information from page1 to page2 using Hidden fields or some other way and then make a final update on Page2 only. So this will not affect page_unload or refresh.
Aug 7 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Matt | last post by:
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...
4
by: Stephajn Craig | last post by:
I have one page that may take a while to process on the server, and I'd like to implement a please wait message on this page when it posts back to the server and does its business. The page is...
2
by: adam | last post by:
Hi ASP Expert, I encounter a page reload situation in ASP. It is I need a way to differentiate whether the current page - "Application_Result.asp" got reloaded itself when user click on the...
1
by: mgonzales3 | last post by:
I have a popup that does a postback to populate a listbox. on my content page I want to fire a jscript that will refresh the parent on the unload. the code on the content page looks like this. ...
1
by: Donkey Cart Racer | last post by:
Hi, I have a page - page1 which opens a window1 where users can look at tasks, in window1 users can click and open window2 where they can create new tasks I want to refresh window1 when...
1
by: BennyVK | last post by:
Hi, I'm not sure if this question should go to the "JavaScript" section; but I'm open to non-JavaScript (like VBScript) options too. So, I'm posting this here. I have the following problem:...
1
by: Areric | last post by:
Hey all, Does anyone know how i can detect a refresh of the page in the unload event on the server? The problem I'm having is that refresh automatically calls the previous event that happened...
2
by: sanjeevcis | last post by:
Hi Everybody, Is there any way to differentiate window closing and window refreshing. Actually I need the code regarding this. I want to get the Popup when i...
5
by: =?Utf-8?B?U3RldmVuIFRhbmc=?= | last post by:
It seems that one page XBAP whose Unloaded event never get called, I need put some clearing stuff (I.G stop dispatcher time) when user close browser, it unload event doesn't work, where shall I...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
1
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.