我必須在文件下載後重定向到同一頁面!下載文件後無法重定向
當我說的Response.Redirect ..它說後HTTP標頭已被送往
能有人幫我這個不能重定向?
我使用ionic.zip壓縮文件並下載它。
PS:讓我知道,如果我必須做我的問題更加清晰,我可以解釋:(
Response.Clear();
Response.BufferOutput = false;
string filename = "results" + ".zip";
Response.ContentType = "application/zip";
Response.AddHeader("content-disposition", "filename=" + filename);
using (ZipFile zip = new ZipFile())
{
zip.AddDirectory(pathhdf.Value);
zip.Save(Response.OutputStream);
}
Response.Close();
Response.Redirect("Default.aspx"); /// here come my error
在此先感謝
似乎是這樣的一個類似的問題:http://stackoverflow.com/questions/10778426/how-not-to-abort-http-response-c-sharp – Quintium
謝謝我力氣找到這:) – helpme