I have a multiple page FRAME in asp.net in a tightly controlled intranet
app. If the user clicks the X close window/browser button, I simply want
to check that a certain Session variable equals something; if it does,
give the user a confirm box (javascript) that closing the window will
cause data loss; hitting OK processes the close.
I've found the javascript for the hmtl section, but it first sets a flag
variable (properExit) to false". Depending on my session variable, how
do I set the flag variable to true, to bypass the confirmExit function?
SCRIPT:
<script language="javas cript">
var properExit = "false";
function confirmExit() {
if (properExit != "true") {
return "Closing the browser will cause loss of data.
To continue, click OK, to return to the form click
Cancel.";
}
}
</script>
<BODY....onBefo reUnload='retur n confirmExit();' />
Thanks.
Kathy
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!