I don't think you can accomplish what you want to do. After the server has sent the HTML to the client, the connection is disconnected until the client browser submits another request to the server.
You could try something like <frameset cols="*,150" frameborder="1" onUnload="window.open('gotopage.asp')">
Then execute the function on the gotopage.asp. When the function is over, use this code response.write "<script language=JavaScript>" response.write "if (top != self) {" response.write "top.location = location" response.write "}" response.write "window.close()" response.write "</script>"
to close the gotopage.asp
"Our great computers fill the Hallowed Halls." - RUSH 2112