◆◇◆ aspx 页面转 excel 出现乱码! ◆◇◆
我想将 aspx 页面转成 excel,但中文会出现乱码。但在另一个页面中,却不会出现这种情况。
请问应该如何解决?代码如下:
if (Request.QueryString["type"] == "excel")
{
this.pnltab.Visible = false;
Response.Charset = "gb2312";
Response.ContentEncoding = System.Text.Encoding.GetEncoding("gb2312");
Response.ContentType = "application/ms-excel";
Response.AppendHeader("Content-Disposition","attachment;filename=grid.xls");
this.dgd.DataSource = ds.Tables[0].DefaultView;
this.dgd.DataBind();
}