Response.ContentType = "application/vnd.ms-excel";
Response.Charset = "";
this.EnableViewState = false;
System.IO.StringWriter tw = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw);
rptlist.RenderControl(hw);//设置你要导出内容的控件,我这里是Repeater
Response.Write(tw.ToString());
Response.End();
Response.Charset = "";
this.EnableViewState = false;
System.IO.StringWriter tw = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw);
rptlist.RenderControl(hw);//设置你要导出内容的控件,我这里是Repeater
Response.Write(tw.ToString());
Response.End();