希望asp.net中的文件下载可以被idm,dap等下载管理器检测到吗?

时间:2013-03-26 09:24:15

标签: asp.net gridview

这是我的代码

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等下载管理器可以检测到它。

请帮忙

0 个答案:

没有答案