7 个解决方案
#1
问题补充 就在IE里不好使 不管是ie6还是7 其它工具都正常(遨游/腾讯的tt浏览器)
#2
代码拿出来看看
#3
dm
#4
代码 很普通啊 page_load 就不用了吧 反填页面而已 最后调下面的公共方法
public static void ExprtWord(HttpResponse Response, Control c,string filename)
{
System.IO.StringWriter SW = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter HTW = new System.Web.UI.HtmlTextWriter(SW);
c.EnableViewState = false;
c.RenderControl(HTW);
Response.Buffer = true;
Response.ContentType = "application/ms-winword";
Response.Charset = "utf-8";
Response.ContentEncoding = System.Text.Encoding.GetEncoding("gb2312");
Response.AddHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(filename, System.Text.Encoding.UTF8) + ".doc");
Response.Write(SW.ToString());
Response.Flush();
Response.End();
}
public static void ExprtWord(HttpResponse Response, Control c,string filename)
{
System.IO.StringWriter SW = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter HTW = new System.Web.UI.HtmlTextWriter(SW);
c.EnableViewState = false;
c.RenderControl(HTW);
Response.Buffer = true;
Response.ContentType = "application/ms-winword";
Response.Charset = "utf-8";
Response.ContentEncoding = System.Text.Encoding.GetEncoding("gb2312");
Response.AddHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(filename, System.Text.Encoding.UTF8) + ".doc");
Response.Write(SW.ToString());
Response.Flush();
Response.End();
}
#5
晕 下沉的好快 小顶一下
#6
帮帮忙啦~~~
#7
Response.ContentType = "application/msword";
#1
问题补充 就在IE里不好使 不管是ie6还是7 其它工具都正常(遨游/腾讯的tt浏览器)
#2
代码拿出来看看
#3
dm
#4
代码 很普通啊 page_load 就不用了吧 反填页面而已 最后调下面的公共方法
public static void ExprtWord(HttpResponse Response, Control c,string filename)
{
System.IO.StringWriter SW = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter HTW = new System.Web.UI.HtmlTextWriter(SW);
c.EnableViewState = false;
c.RenderControl(HTW);
Response.Buffer = true;
Response.ContentType = "application/ms-winword";
Response.Charset = "utf-8";
Response.ContentEncoding = System.Text.Encoding.GetEncoding("gb2312");
Response.AddHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(filename, System.Text.Encoding.UTF8) + ".doc");
Response.Write(SW.ToString());
Response.Flush();
Response.End();
}
public static void ExprtWord(HttpResponse Response, Control c,string filename)
{
System.IO.StringWriter SW = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter HTW = new System.Web.UI.HtmlTextWriter(SW);
c.EnableViewState = false;
c.RenderControl(HTW);
Response.Buffer = true;
Response.ContentType = "application/ms-winword";
Response.Charset = "utf-8";
Response.ContentEncoding = System.Text.Encoding.GetEncoding("gb2312");
Response.AddHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(filename, System.Text.Encoding.UTF8) + ".doc");
Response.Write(SW.ToString());
Response.Flush();
Response.End();
}
#5
晕 下沉的好快 小顶一下
#6
帮帮忙啦~~~
#7
Response.ContentType = "application/msword";