Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Is there a way to tell if a user is leaving the page?

Reply
Thread Tools

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

 
 
Chris Roden
Guest
Posts: n/a
 
      12-13-2007
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!

 
Reply With Quote
 
 
 
 
Mark Rae [MVP]
Guest
Posts: n/a
 
      12-13-2007
"Chris Roden" <> wrote in message
news:3AB6A159-9061-4585-AD54-...

> Any assistance is greatly appreciated!


Not possible.

There are several suggested kludges with <body onunload> but none of them
works properly.

Don't even bother trying...


--
Mark Rae
ASP.NET MVP
http://www.markrae.net

 
Reply With Quote
 
 
 
 
Peter Bromberg [C# MVP]
Guest
Posts: n/a
 
      12-13-2007
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!
>

 
Reply With Quote
 
msgroup
Guest
Posts: n/a
 
      12-13-2007
Hi, Chris:

It seems to me that SocketPro is able to solve your particular problem. See
the site http://www.udaparts.com/document/art...ercallback.htm

function onMyUnload() //close socket connection

{

if(clientsocket){

handler.tell('I am leaving this page now ......');

clientsocket.WaitAll();

if(handler)

clientsocket.Detach(handler);

clientsocket.Disconnect();

}

clientsocket = null;

handler = null;

}



Cheers!



"Chris Roden" <> wrote in message
news:3AB6A159-9061-4585-AD54-...
>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!
>



 
Reply With Quote
 
Mark Rae [MVP]
Guest
Posts: n/a
 
      12-13-2007
"Peter Bromberg [C# MVP]" <> wrote in message
news:C20E11C0-6488-44E1-9937-...

> 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
is there a way to tell the compiler that an object exists in adifferent translation unit? aaragon C++ 4 11-26-2007 03:35 AM
Is there a way to tell if a script has been run by Pythonw.exe instead of Python.exe? Metalone Python 5 10-19-2007 08:25 PM
Re: Is there an easy way to tell if 2.0 framework is installed on a se Samuel R. Neff ASP .Net 1 01-23-2007 10:30 PM
Is there a way to differ between refresh (F5) and leaving in onUnload? Dag Sunde Javascript 3 03-23-2005 09:15 AM
RANDRECO.EXE = Still there & ain't leaving! Daniel Computer Support 20 12-24-2004 01:11 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57