473,388 Members | 875 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Differentiate between a page unload and a page refresh.

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 2370
shweta123
692 Expert 512MB
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
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...

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.