How to close the browser using C#?
<p>When my Login button is clicked, if the login was successful I'd like to close the browser.</p>

<pre><code>protected void btnLogin_Click(object sender, AuthenticateEventArgs e)
{
 if (isAuthenticated)
{
// close the browser
}
}
</code></pre>

<p>I'm not using AJAX so this happens on code behind.</p>

<p>How to send a command (or a javascript call) to the browser to close itself using C# and perhaps using Response... object?</p>

<p>thanks,</p>

<p>UPDATE on the Answer (it closes without warning):</p>

<pre><code>const string scriptKey = "closeBrowser";
            if (!ClientScript.IsClientScriptBlockRegistered(scriptKey))
            {
                ClientScript.RegisterClientScriptBlock(this.GetType(), scriptKey, "javascript:setTimeout('parent.Shadowbox.close();', 1000);", true);
            }
</code></pre>
