Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerParserErrorException: 无法分析从服务器收到的消息。之所以出现此错误,常见的原因是: 在通过调用 Response.Write() 修改响应时,将启用响应筛选器、HttpModule 或服务器跟踪。
详细信息: 分析附近的“+ADw-div+AD4-
+ADw”时出错。执行代码如下:
public static void toFiles(int Model, GridView gv)
{
string strFileName = DateTime.Now.ToString("yyyyMMdd-hhmmss");
System.Web.HttpContext HC = System.Web.HttpContext.Current;
HC.Response.Clear();
HC.Response.Buffer = true;
HC.Response.Charset = "GB2312";
HC.Response.AppendHeader("Content-Disposition", "attachment;filename=kc.xls");
//gaoyang [10/21/2006] 经测试如果设置为 GetEncoding("GB2312"),导出的文件将会出现乱码。 HC.Response.ContentEncoding = System.Text.Encoding.UTF7;
if (Model == 1)
{
HC.Response.AddHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(strFileName, System.Text.Encoding.UTF7) + ".xls");
HC.Response.ContentType = "application/ms-excel";//设置输出文件类型为excel文件。 }
System.IO.StringWriter sw = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htw = new System.Web.UI.HtmlTextWriter(sw);
gv.RenderControl(htw);
HC.Response.Write(sw.ToString());
HC.Response.End();
} HC.Response.End();执行到这句时候出现以上错误,请高手给予指点.
详细信息: 分析附近的“+ADw-div+AD4-
+ADw”时出错。执行代码如下:
public static void toFiles(int Model, GridView gv)
{
string strFileName = DateTime.Now.ToString("yyyyMMdd-hhmmss");
System.Web.HttpContext HC = System.Web.HttpContext.Current;
HC.Response.Clear();
HC.Response.Buffer = true;
HC.Response.Charset = "GB2312";
HC.Response.AppendHeader("Content-Disposition", "attachment;filename=kc.xls");
//gaoyang [10/21/2006] 经测试如果设置为 GetEncoding("GB2312"),导出的文件将会出现乱码。 HC.Response.ContentEncoding = System.Text.Encoding.UTF7;
if (Model == 1)
{
HC.Response.AddHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(strFileName, System.Text.Encoding.UTF7) + ".xls");
HC.Response.ContentType = "application/ms-excel";//设置输出文件类型为excel文件。 }
System.IO.StringWriter sw = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htw = new System.Web.UI.HtmlTextWriter(sw);
gv.RenderControl(htw);
HC.Response.Write(sw.ToString());
HC.Response.End();
} HC.Response.End();执行到这句时候出现以上错误,请高手给予指点.
+ADw”时出错。
错误信息 着重看看 这地方