I need to do a postback from my application when a user decides to navigate away/close the page. I think I might be able to do this with javascript. I've tried window.onunload and window.unload, but neither seem to be able to actually do a postback here:
<script type="text/javascript">
window.onunload = function() {
document.forms[0].submit();
}
</script>
My scenario: I have a form that I want to capture data from if the user decides to quit in the middle of filling it out. It's quite lengthy, so I'd like to save the data so they can continue working on it later.
Maybe it might be better to do some timed event?
Thanks to anyone who can help!