How to close browser window in c#
<p><strong>c#</strong></p>

<pre><code>protected void btnSave_Click(object sender, EventArgs e) {
      ScriptManager.RegisterStartupScript(this, this.GetType(), 
                   "closescript", "closeWindow();", true);        
}
</code></pre>

<p><strong>JavaScript</strong></p>

<pre><code>function closeWindow() {            
    window.close();
    return false;
}
</code></pre>

<p>I am trying to execute the above code on button click but another window is created and then alert is generated asking,  "do you want to close?"</p>

<p>If I click "yes" then the window will close.</p>
