Cannot close fancybox from server side
<p>I tried this:</p>

<pre><code>if (pdfDocumentinBytes!= null)
{
    Response.Clear();
    Response.ClearHeaders();
    Response.ClearContent();
    Response.ContentType = "application/pdf";
    Response.AppendHeader("Content", "attachment; filename=" + this.documentName + ".pdf");
    Response.BinaryWrite(pdfDocumentinBytes);
    Response.End();
}

ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "script", "fancyboxClose();", true);
</code></pre>

<p><code>fancyboxClose()</code> is a function which just closes the fancy box when called from server side.</p>