线程正被中止,这是怎么回事???大哥,大姐,帮帮忙
public void ToExcel1(System.Web.UI.Control ctl)
{
dgProjectInfo.DataSource = (DataTable)Session["TempReport"];
dgProjectInfo.AllowPaging = false;
dgProjectInfo.AllowSorting = false;
dgProjectInfo.DataBind();
Response.ClearContent();
Response.Charset = "GB2312";
Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
Response.AddHeader("content-disposition", "attachment; filename=MyExcelFile.xls");
Response.ContentType = "application/excel";
StringWriter sw = new StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
ctl.RenderControl(htw);
Response.Write(sw.ToString());
Response.End();
}
导出Excel的时候,出现异常 异常是线程正被中止,这是为什么呀!