【发布时间】:2014-09-24 18:59:15
【问题描述】:
下载文件后我必须执行更多代码,但它没有发生。编译器在DownloadFile(); 之后命中ClearControls();,但函数没有执行。
在页面上,我收到打开或保存文件的提示。但是文本框没有被清除。
这种情况下应该怎么办。
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="";
}
【问题讨论】:
标签: c# asp.net c#-4.0 threadabortexception