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

Is there a way to tell if a user is leaving the page?

I am working on an ASP.NET application utilizing .NET 3.5. One page is using
a multi-view with 10 views. UpdatePanels are used to navigate from one view
to another. There are hundreds of fields and I want to be able to prompt the
user to save if they are leaving the PAGE, not the view. The user should be
able to move freely from view to view, but should be prompted to save if they
try to leave the page. I am at a loss and can't figure this out. Any
assistance is greatly appreciated!

Dec 13 '07 #1
3 1156
"Chris Roden" <Ch********@discussions.microsoft.comwrote in message
news:3A**********************************@microsof t.com...
Any assistance is greatly appreciated!
Not possible.

There are several suggested kludges with <body onunloadbut none of them
works properly.

Don't even bother trying...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Dec 13 '07 #2
Chris,
You have to remember that whatever a user does with your "page" once it gets
into their browser, there is no way the server can have any "knowledge" of
this. There are some things you can do client-side, however. This is an old
article but all the concepts still hold:
http://www.eggheadcafe.com/articles/20010406.asp
--Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
MetaFinder: http://www.blogmetafinder.com
"Chris Roden" wrote:
I am working on an ASP.NET application utilizing .NET 3.5. One page is using
a multi-view with 10 views. UpdatePanels are used to navigate from one view
to another. There are hundreds of fields and I want to be able to prompt the
user to save if they are leaving the PAGE, not the view. The user should be
able to move freely from view to view, but should be prompted to save if they
try to leave the page. I am at a loss and can't figure this out. Any
assistance is greatly appreciated!
Dec 13 '07 #3
"Peter Bromberg [C# MVP]" <pb*******@yahoo.NoSpamMaam.comwrote in message
news:C2**********************************@microsof t.com...
There are some things you can do client-side, however.
Yes, but that's just common sense validation... As you say, the server can't
know anything of this...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Dec 13 '07 #4

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

Similar topics

6
by: gsb | last post by:
I trying to use sessions to save a user name/id after login. If the user leaves the site and comes back, how do I force a new session and login?
3
by: sancha | last post by:
Hi, I need to promt the user when he moves away from the page by clicking an of the links available on the page. I was trying to use the onbeforeunload function but it seems it is a jScript...
8
by: Zvonko | last post by:
Hi! Is it possible to capture an event when user leaves the page and execute some code? Not when he closes the window. Any ideas?
4
by: Tone Curtis | last post by:
I have a set of webforms where I need to prompt the user to "Save Changes". I can handle this to a degree within the form but if the user presses the Back button or selects the Home button the data...
8
by: pamelafluente | last post by:
I am reposting hoping better luck :) I can't achieve this simple thing: I have an animated gif in an image control (ImageProgress1). The image visibility is set to false. I want that when the...
1
by: Greg Stevens | last post by:
Here is the situation. I'm developing an application where: I have defined a class (DBClass) to provide an abstraction layer for interacting with a database. When an instance of the class is...
4
by: =?Utf-8?B?RGVhbiBHYXJyZXR0?= | last post by:
I'm writing a .NET 2.0 app that needs to manage user sessions. We're using SQL Server 2005 tables to hold sessions status fields in a table. The problem is how to handle the situation where a user...
5
by: nic829 | last post by:
I am trying to write a code such that when user close the browser or netvigate to other page, a message box will show up. <SCRIPT> function closeIt() { event.returnValue =...
5
by: =?Utf-8?B?QW5keQ==?= | last post by:
As per the question really. Not trying to stop them leaving, but just detect WHEN they leave the site
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...
0
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...
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
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...

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.