Well, I'm not really clear what you're trying to do, but guessing from the original post, "I need to be able to trigger the new window opening within the
VB.NET code of my aspx page upon completion of searching the database (not when the user clicks on a link or button)."...
I assume you have a sub on the server that is querying the database, because a thin client can't do that.
But from your description, it seems you have a browser sitting there displaying something, and waiting for a database query. That part I don't understand, because HTTP is a connectionless protocol. The server cannot just send something to the browser when it gets ready. The browser has to request it. So the user [u]has</u> to click a button or there [u]has</u> to be a script that works on a timer and reposts to the server, or [u]something</u>...
So, for the next step, I'm too confused without more info.
But I can say this: no, you don't have to have javascript inside a function. If you want the browser to execute it immediately as it loads the page, you can just put out a script like:
<script>
openWin();
</script>
-Van
(Old dog learning new tricks...)