A
Alejandro Penate-Diaz
Hi. I have posted this question three times in this newsgroup as well as
microsoft.public.scripting.jscript and have get no answer yet. Now I dont
know if my question is too stupid or too weird, though usually my stupid
questions get some funny answers. I am gona try once more before I give up
on this one.
I need to ask the user whether to save the information on a page to a
sql server when exiting or navigating away, so I am using this code when
clicking the X button (top right close button). Button8 (is an asp.net
server control) does
that(save to database) when clicked so I am reusing
it in my javascript:
//this code is launched in the OnBeforeUnload event in the <body> section
function HandleOnClose()
{
if (event.clientY < 0)
if (confirm("OK to save changes. Cancel to exit without saving.") )
__doPostBack('Button8','')
}
The code above works fine, problem comes with the following code that I am
using when the user clicks a link to another page, code
__doPostBack('Button8','') is never executed. is there a simple work around
for what I want to do?:
// this code is launched when clickin in my page's links
function goToAnotherPage()
{
if (confirm("OK to save changes. Cancel to show Another Page without
saving.") ) __doPostBack('Button8','');
window.navigate("another_page.aspx");
}
microsoft.public.scripting.jscript and have get no answer yet. Now I dont
know if my question is too stupid or too weird, though usually my stupid
questions get some funny answers. I am gona try once more before I give up
on this one.
I need to ask the user whether to save the information on a page to a
sql server when exiting or navigating away, so I am using this code when
clicking the X button (top right close button). Button8 (is an asp.net
server control) does
that(save to database) when clicked so I am reusing
it in my javascript:
//this code is launched in the OnBeforeUnload event in the <body> section
function HandleOnClose()
{
if (event.clientY < 0)
if (confirm("OK to save changes. Cancel to exit without saving.") )
__doPostBack('Button8','')
}
The code above works fine, problem comes with the following code that I am
using when the user clicks a link to another page, code
__doPostBack('Button8','') is never executed. is there a simple work around
for what I want to do?:
// this code is launched when clickin in my page's links
function goToAnotherPage()
{
if (confirm("OK to save changes. Cancel to show Another Page without
saving.") ) __doPostBack('Button8','');
window.navigate("another_page.aspx");
}