浏览器中,响应事件执行下载后,页面就不能操作了。
Error:拒绝访问。
在弹出下载提示框时,如果是打开文件,就不会有问题,而保存文件到本地之后,就出问题了。
代码如下:
string filepath =Page.Server.MapPath(pathHid.Value);//+"";

string filename = System.IO.Path.GetFileName(filepath);
//Response.Clear();
Response.ContentType = "application/octet-stream";
Response.AddHeader("Content-Disposition", "attachment; filename=" +HttpUtility.UrlEncode(aliasHid.Value,System.Text.Encoding.UTF8));
Response.Flush();
Response.WriteFile(filepath);