Problems opening/closing a 'popped-up' window
<p>I have a web app that launches from an online portal into a new browser window. Everything works out fine until I try to open a new window or close the window from the webapp. Everything works fine when I test it locally though.</p>

<p>From what I've understood so far, after some Googling, it seems that this is because you can't call client side code from server side, for security reasons. I'll post what I've tried to implement for the Open and Close functions below:</p>

<h3>Open</h3>

<pre><code>String javaScript = "window.open('http://www.google.com', null, 'height=555,width=760,
                                  status=yes,toolbar=no,menubar=no,
                                  location=no, scrollbars=yes');";

ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", javaScript, true);
</code></pre>

<h3>Close</h3>

<p><code>&lt;a href="javascript:window.open('','_parent','');window.close();"&gt;Close Window&lt;/a&gt;</code><br>
as well as  a simple<br>
<code>&lt;a href="JavaScript:window.close()"&gt;Close&lt;/a&gt;</code><br>
in the HTML itself.</p>

<p>I know this question has been asked countless times before, but I've gone diving in the forums and Google and still can't find something that works, so I appreciate any help in this.</p>

<p>For now I'm suspecting that the problem lies in trying to call a pop-up window from another pop-up window for the <em><b>Open</b></em> function, while for the <em><b>Close</b></em> function, the server does not recognize the handle of the window that opened the pop-up.</p>

<h3>Edit:</h3>

<p>My apologies to everyone if I didn't make myself clear enough. I'll try to explain in more detail here.</p>

<p>Basically, in my web application, I have these 2 buttons, Open and Close.<br>
The Open button will open up a link to another website in a brand new browser window.<br>
The Close button will close the browser window that the application is residing in.</p>

<p>When I tested it out locally, i.e. localhost:xxxxx/Game.aspx, everything works fine. However, the app currently does not reside in a separate pop-up window called from another browser window</p>

<p>On the test server, the application is launched into a new browser window from an online game repository portal.</p>

<p>So just to re-illustrate the way I want it to work:<br>
1. User logs into game repository page<br>
2. User chooses a game to play<br>
3. Game pops up in a new browser window<br>
4. When user clicks on Open button, another new window pops up to a specific website(Does not work)<br>
5. When user clicks on Close button, the game window closes itself(Does not work)  </p>

<p>I hope this makes the issue clearer. Thanks.</p>
