Ask a Question related to ASP.NET General, Design and Development.
-
Kathy Burke #1
OnBeforeUnload event...where to run code BEFORE return msg?
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="javascript">
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....onBeforeUnload='return confirmExit();' />
Thanks.
Kathy
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Kathy Burke Guest
-
Custom control fires event but ignores some code in the code behind file
I do not quite understand the question. I will merely point out that most programming problems happen for a reason. Code works the way it is... -
Not all code paths return a value?
The intent of my web service is an RSS feed from a blog. Originally I used a StringBuilder to make the XML and returned a string from the... -
Query return code question
All... I'm having problems figuring out what pg_query() really returns when there is an error. The documentation says it returns "FALSE",... -
How to get php.exe to return a correct result code
How can I get php.exe to return a correct result code, e.g. one that indicates failure to my make.exe upon for example: Fatal error: Call to... -
crashes with bad return code ...
My computer suddenly crashes with no sign of warning. I didn't install anything new. It happened when I tried to reboot it. Under the safe mode, I...



Reply With Quote

