473,395 Members | 2,795 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,395 software developers and data experts.

How to run code when a web page closes?

I need to check that certain data fields has been saved to a SQL server when
a user leaves a web page (one way or another i.e. by clicking the X (close)
button or the Back-button or...). I don't want to save data at each field. Is
there a page_close ala page_load you can use for this?
Nov 19 '05 #1
2 3560
Nope, no page_close
What you normally is hook into the javascript onbeforeunload event...open up
a new window (popup) which onload does wha tyou need it to do.

This should get you started:
http://www.4guysfromrolla.com/webtech/100604-1.shtml

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Norseman" <No******@discussions.microsoft.com> wrote in message
news:DA**********************************@microsof t.com...
I need to check that certain data fields has been saved to a SQL server
when
a user leaves a web page (one way or another i.e. by clicking the X
(close)
button or the Back-button or...). I don't want to save data at each field.
Is
there a page_close ala page_load you can use for this?

Nov 19 '05 #2
Thanks! It looks like just what I'm after, I'll test it later.

Norseman
"Karl Seguin" wrote:
Nope, no page_close
What you normally is hook into the javascript onbeforeunload event...open up
a new window (popup) which onload does wha tyou need it to do.

This should get you started:
http://www.4guysfromrolla.com/webtech/100604-1.shtml

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Norseman" <No******@discussions.microsoft.com> wrote in message
news:DA**********************************@microsof t.com...
I need to check that certain data fields has been saved to a SQL server
when
a user leaves a web page (one way or another i.e. by clicking the X
(close)
button or the Back-button or...). I don't want to save data at each field.
Is
there a page_close ala page_load you can use for this?


Nov 19 '05 #3

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

Similar topics

1
by: Rod Early | last post by:
I need to know when the select element's dropdown list is opened (as when the user clicks on the arrow or does ALT-downarrow from the keyboard). Similarly, I need to known when the dropdown list...
8
by: gremlinbass | last post by:
I was wondering if I can check to see if a file is open? Specifically, is there any way I can code Access to check to see if a text file (datasource.txt to be specific) is open, returning a true...
1
by: Samy | last post by:
Hi There, I have a child window opened from aspx page using window.open. On the child window, I have a button(New category) which opens a grandchild. I also have a cancel button on the child...
2
by: Roy Scarisbrick | last post by:
I have a programming issue on an ASP.Net web page. I suspect the issue would apply to any version of ASP though. I have a questionnaire page where a user will answer a bunch of questions with...
1
by: buran | last post by:
Dear ASP.NET Programmers, I am developing an intranet application using ASP.NET. I want to add such a functionality that the application displays a pop-up box to confirm when the user tries to...
6
by: Paolo Pignatelli | last post by:
I have an aspx code behind page that goes something like this in the HTML view: <asp:HyperLink id=HyperLink1 runat="server" NavigateUrl='<%#"mailto:" &amp;...
6
by: Annie | last post by:
Hi guys, I just want to do some clean up in the Session_End at Global.aspx. However, if the user closes the browser window that event is not fired. how can I call explicity protected void...
0
by: richardkreidl | last post by:
I have the following hash script that I use to compare two text files. 'Class Public Class FileComparison Public Class FileComparisonException Public Enum ExceptionType U 'Unknown A 'Add...
3
by: Ricardo Vazquez | last post by:
Hi! I have a new problem with this SCENARIO I already described in a previous post: - PBX (a private telephone exchange or switch) - A Telephony Server Application running on computer "A" (it...
13
by: Gouri.Mahajan7 | last post by:
Hello, Can anybody please tell me how to trap the browser close event. when that is fired I want to call the web method. Thanks in advance. Regards, Gouri.
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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
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...
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...
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,...

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.