你试试这样!!!
public static void ExpToExcel(System.Web.UI.Page In_Page,DataGrid In_DataGrid,string Title)
{
HttpResponse Resp=In_Page.Response;
string strFileName= ……//自己订个命名规则;
Resp.ContentEncoding = Encoding.GetEncoding("GB2312");
Resp.AppendHeader("Content-Disposition", "attachment;filename="+ strFileName);
System.IO.StringWriter objWriter=new System.IO.StringWriter();
HtmlTextWriter objHtmWriter=new HtmlTextWriter(objWriter);
In_DataGrid.RenderControl(objHtmWriter);
Resp.Write("<DIV Align=Center>"+Title+"</DIV>");
Resp.Write(objWriter.ToString());
Resp.End();
}