--代码如下
Response.AddHeader( "Content-Disposition ", "attachment; filename=ExcelFile ")
Response.Charset = "UTF-8 "
Response.ContentType = "application/vnd.ms-excel "
Response.Charset = " "
Me.EnableViewState = False
Dim tw As New System.IO.StringWriter
Dim hw As New System.Web.UI.HtmlTextWriter(tw)
tblsbu.RenderControl(hw)
Response.Write(tw.ToString())
Response.End()
------解决方案--------------------------------------------------------
Response.ContentType = "application/vnd.ms-excel "
Response.AddHeader( "Content-Disposition ", "attachment; filename=ExcelFile ",Encoding.UTF8)
Me.EnableViewState = False
Dim tw As New System.IO.StringWriter
Dim hw As New System.Web.UI.HtmlTextWriter(tw)
tblsbu.RenderControl(hw)
Response.Write(tw.ToString())
Response.End()