I have to execute some more code after downloading a file, but itsn't happening. The compiler hits `ClearControls();` after `DownloadFile();`, but the function is not executed.
On the page I get the prompt to open or save the file. But the textboxes are not cleared.
What should be done in this case.
protected void btnOk_Click(object sender, EventArgs e)
{
//ClearControls(); // not working here too.
DownloadFile();
ClearControls();
}
private void DownloadFile()
{
Response.ContentType = "application/pdf";
Response.AppendHeader("Content-Disposition","attachment;filename="+sName+".pdf");
Response.TransmitFile(Server.MapPath("~/documents/ready/" + strPdfName));
//Response.End();
HttpContext.Current.ApplicationInstance.CompleteRequest();
}
private void ClearControls()
{
txtOne.Text="";
txtTwo.Text="";
}