这是我的代码
Response.ClearHeaders();
Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=GridView2WordMethod2.doc");
Response.AddHeader("Content-Type", "application/octet-stream");
//Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentType = "application/octet-stream";
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
HtmlForm frm = new HtmlForm();
exportGrdVw.Parent.Controls.Add(frm);
frm.Attributes["runat"] = "server";
frm.Controls.Add(exportGrdVw);
frm.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();
正在工作并将gridview的内容下载到Doc文件,但是使用chrome默认下载管理器下载。我希望IDM,DAp等下载管理器可以检测到它。
请帮忙