Response.ContentType = "application/vnd.ms-excel";
Response.Charset = "";
EnableViewState = false;
System.IO.StringWriter tw = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw);
this.DataGrid1.RenderControl(hw);//将DATAGRID中的内容输出到HtmlTextWriter对象中
Response.Write(tw.ToString());
Response.End();
在没有框架下这么写就可以了,但是在框架下为什么就不可以呢!谁能告诉我





2007-5-23 14:40 

