That still wouldn't work if the user just closes the browser or types a new
web address into the address bar, selects a favorite, etc.
The only reliable way I know of is to handle the onbeforeunload event in the
browser. In this handler, you then prompt the user to cancel the operation,
and maybe make a server side call to save the data. However, the caveat is
that this event fires even if the user is just navigating to the next
logical page in your application via a link or button. So, you have to have
code that keeps track of what the user has been doing, so your handler knows
if this event is being called because the user is actually trying to close
your application, or just because the user is making a request via some
functionality in your application, and so the current page is being
unloaded.
"Mark Fitzpatrick" <ma******@fitzme.com> wrote in message
news:eE**************@TK2MSFTNGP15.phx.gbl...
Unfortunately, there is no such thing. Since the browser is completely
disconnected from the server immediately after it loads the last item
required for that page, there's no way to trap this. You would have to so
something like create an onclick hander for each anchor on the page that
would fire some script to remind them, perhaps a message box that reminds
them and forces them to click yes to continue and leave or no and not be
redirected.
Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage
"Gordowey" <al************@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com... Is there an event fired when I exit from an aspx.page?
I mean, if the user clicks in any other link available on the screen, i
would like to caught thta event and pop-up , remembering to save
unsaved data...
is that possible??
Thanks
Alberto