no, they would not have to stay on the page.
the code is initiated on the server and will continue running regardless of the page being opened in the browser or not.
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.