Refresh a page after content disposition in ASP.NET
<p>We are developing a web application in which, one page opens a PDF file after we click "Generate Report". This PDF file is displayed as an attachment using <strong>response.AddHeader("Content-Disposition", "attachment; filename=" + FileName + ";");</strong></p>

<p>It is required that <strong>we have to refresh the page</strong> as well (persisting the input parameters we passed in the text fields as part of generating the PDF file). I tried to use ** response.Redirect(Request.Url.ToString());** How ever, the page is not getting refreshed.</p>

<p>For your reference, I am sending the code below.</p>

<pre><code>    String filePath = this.Page.MapPath(FileName);
    System.Web.HttpResponse response = System.Web.HttpContext.Current.Response;
    response.ClearContent();
    response.Clear();
    response.ContentType = "text/plain";
    response.AddHeader("Content-Disposition", "attachment; filename=" + FileName + ";");
    response.TransmitFile(filePath);
    response.Flush();
    response.Redirect(Request.Url.ToString());
    response.End();
</code></pre>

<p>Please update me if there is a better way of achieving this.</p>

<p>Thanks,
Sriram</p>
