Response.AppendHeader("Content-Disposition", "attachment;filename=nianjian.xls")
Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312")
Response.ContentType = "application/ms-excel"
Response.OutputStream.Write(gifstream.ToArray, 0, gifstream.Length.ToString)
Response.End() 估计楼主是没有确定文件格式,才不出下载对话框的
Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312")
Response.ContentType = "application/ms-excel"
Response.OutputStream.Write(gifstream.ToArray, 0, gifstream.Length.ToString)
Response.End() 估计楼主是没有确定文件格式,才不出下载对话框的
Response.Clear();
Response.Buffer = true;
Response.Charset = "GB2312";
Response.AppendHeader("Content-Disposition", "attachment;filename=aa.txt");
Response.ContentType = "application/ms-txt";
Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
Response.Write(txt1);
Response.Flush();
Response.Close();
Response.End();
2,B页面有GridView数据源的绑定,和一些文件的上下载操作,由于showmodaldialog的一些属性致使B页面在刷新动作时又重新打开一个新的窗口,为了防止重新打开B页面,我在B页面的<head>处加了<base target="_self"/>,这样一来就不会在B页面的刷新操作动作上又打开新的B页面了
3,B页面中的下载文件操作,<base target="_self"/>导致下载窗口无法弹出。我现在要解决的问题就是在B页面中如果有刷新动作不重新打开新的B页面,但可以弹出下载窗口,同时B页面是由A页面showmodaldialog()出来的。
高人来解决一下