Generating pdf before leaving a page in Asp.net
<p>After submitting a form and before Redirecting a page need to generate a pdf, ask the user to save the file, then redirect the page .</p>

<p>Below is my code        </p>

<pre><code>  DataSet objData = objInsert.Execute();

  DocLib dl = new DocLib();

  System.IO.MemoryStream ms = dl.GenerateForm(objData.Tables[0].Rows[0]);

  Response.AddHeader("content-disposition", "attachment;filename=" +OrderNo + ".pdf");
  Response.OutputStream.Write(ms.GetBuffer(), 0, ms.GetBuffer().Length);
  Response.OutputStream.Flush();
  Response.OutputStream.Close();

  Response.Redirect("OrderList.aspx");
</code></pre>

<p>But currently once the save dialog box appears the page stops navigation and remains in the same page.  How to redirect to another page.</p>
