List Info

Thread: OnUnload and OnBeforeUnload handling




OnUnload and OnBeforeUnload handling
country flaguser name
United States
2007-09-06 13:36:38
I'm trying to get a better grasp of how to handle unload
events on a
form where the user expects the form to save automatically
without
prompting. (Verbally stated expectation, not necessarily a
reasonable
expectation.)

Essentially, I need it to post the data before the window
closes or is
navigated away from. I'm using a .NET 2.x aspx component
library which
gives me an AJAX option, solving the problem of my postback
preventing
the user's navigation, however, the navigation or closing
occurs
before the update has finished occurring about half the
time. Since
it's in a component library, all I can do is call the event
tied to
the component's save button. Is there any way to get the
close
behavior to be consistent and allow the AJAX to work its
magic before
closing?

I realize it's not going to be something that works across
all
browsers, as both AJAX and the unload itself are very
inconsistently
supported, but I'd like to come up with a solution primarily
for IE6/7
users, and secondarily for Mozilla and Safari users.
References on how
to consistently handle unloads would also be helpful. It's
an internal
app in this case, so I can lock down what browser and that
javascript
is turned on, but I'd like to know what I'm doing wrong in
case I have
to do this on the public side someday.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "JavaScript Forum" group.
To post to this group, send email to
JavaScript-Informationgooglegroups.com
To unsubscribe from this group, send email to
JavaScript-Information-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/JavaScript-Information
?hl=en
-~----------~----~----~----~------~----~------~--~---


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )