P
Peter Larsen [CPH]
Hi,
How do i track when i move away from a page - aka "window.onbeforeunload",
but on server side.
If you think of a sample where you have some textbox's and you want to get
the contents, before moving away from the page, but you don't want to use
post-back on each textbox. How is that done ??
At the moment, i'm trying an idea where i use the following script in on
window.onbeforeunload. This gives me a postback where i have the opportunity
to read from the page before moving away (or if a button is pushed and
similar stuff).
function doOnBeforeUnload()
{
__doPostBack('nothing', '');
}
But i am not sure what the consequences are, using this method. Do i break
something or is it a possible solution ??
There is one problem though - if using session states, data could be
overwritten with data from older pages. But that could be solved by writing
a timestamp to the page.
So, is postback a solution or are there other ways to do this ??
Best Regards
Peter
How do i track when i move away from a page - aka "window.onbeforeunload",
but on server side.
If you think of a sample where you have some textbox's and you want to get
the contents, before moving away from the page, but you don't want to use
post-back on each textbox. How is that done ??
At the moment, i'm trying an idea where i use the following script in on
window.onbeforeunload. This gives me a postback where i have the opportunity
to read from the page before moving away (or if a button is pushed and
similar stuff).
function doOnBeforeUnload()
{
__doPostBack('nothing', '');
}
But i am not sure what the consequences are, using this method. Do i break
something or is it a possible solution ??
There is one problem though - if using session states, data could be
overwritten with data from older pages. But that could be solved by writing
a timestamp to the page.
So, is postback a solution or are there other ways to do this ??
Best Regards
Peter