title: Closing an IE 'popup' window with script
body: <p>Is it at all possible to disable the "The webpage you are viewing is trying to close the window.   Do you want to close it?"?</p>
  
  <p>I understand that this is the product of years of virus, and malicious script activity, but in legit app code, (ASP.NET), is there any way to like "register" your app as an APP, or flags you can pass to an IE Popup so that it will not display this when it closes?</p>
  
  <p>The code I'm using is done from within the C# code behind:</p>
  
  <pre><code>ClientScript.RegisterClientScriptBlock(GetType(), "save", Utils.MakeScriptBlock("window.close();")); 
  </code></pre>
  
  <p>The Utils.MakeScriptBlock is just a function that does what you might expect.  It 'injects' a &lt;script...&gt; tag with the code in it...</p>
  
  <p>It's probably not possible to get around this, or else, all the script kiddies would just use that trick, but I thought I'd ask, as I can't be the ONLY one using simple IE "popups" as (pseudo)modal dialog boxes.</p>
  
  <p>This code happens in my ButtonSave_Click() routine, after everything has passed validation, etc...</p>
  
  <p>** <strong>EDIT</strong> **<br>
  Just for reference, here is the code that OPENS the popup, when the ADD button is clicked:
  <p>
  This is in Page&#95;Init()...
  <p></p>
  
  <pre><code>ButtonAdd.Attributes.Add("onclick", "window.open('Add.aspx', 'ADD_WINDOW', 'scrollbars=no,width=550,height=550,location=no,menubar=no,resizable=yes,directories=no,status=no,toolbar=no'); return false;");
  </code></pre>