I need to run some ASP code when I go to close down the browser. I can run Javascript no problem, but I just need to run a funcation that I have set up in me ASP Code.
Can anyone help?
Printable View
I need to run some ASP code when I go to close down the browser. I can run Javascript no problem, but I just need to run a funcation that I have set up in me ASP Code.
Can anyone help?
There's really no way ASP could know when the browser closes.
Can you not run some ASP code by calling <BODY OnUnload="??">
Do yourself a favor, save yourself time. Just put an alert in the unload event. You will see it fires every time even if you refresh your browser.
I wanted to the same effect, but if you refresh ... the function executes...
Just client-side code. You could possibly request an ASP page there to get ASP code to execute, but if the browser is closing, I'm not sure if it will actually request the ASP page.Quote:
Can you not run some ASP code by calling <BODY OnUnload="??">
Thanx for that, sorted it, just in case it may be of help to you heres how its done.
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
function MM_goToURL()
{
var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
//-->
</SCRIPT>
</HEAD>
<BODY OnUnLoad="MM_goToURL('parent','unload.asp')">
I just had unload.asp do the work.