HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment;filename=RoadRepair.doc"); 这行出错,Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: BC30037: Character is not valid.大家帮忙
HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment;filename=RoadRepair.doc");
Response.ContentType = "application/vnd.ms-word" ;//指定生成文件的类型
HttpContext.Current.Response.Charset = "";
HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.Default;
DataGrid1.Page.EnableViewState = false;
System.IO.StringWriter tw=new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter hw=new System.Web.UI.HtmlTextWriter(tw);
DataGrid1.RenderControl(hw);
HttpContext.Current.Response.Write(tw.ToString());
HttpContext.Current.Response.End();
page.Response.Clear();
page.Response.Buffer= true;
page.Response.AppendHeader("Content-Disposition", "Attachment;fileName=" + strFileName );
page.Response.ContentType = "application/vnd.ms-word";
page.Response.Charset = "";
page.EnableViewState = false;
StringWriter oStringWriter = new StringWriter();
HtmlTextWriter oHtmlTextWriter = new HtmlTextWriter(oStringWriter);
dgExcel.RenderControl(oHtmlTextWriter);
page.Response.Write(oStringWriter.ToString());
page.Response.End();
这行出错,Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: BC30037: Character is not valid.大家帮忙