将数据导出到Excel工作表时出错。
Response.Clear()
Response.AddHeader("content-disposition", "attachment;filename=CompletionDatesReport.xls")
Response.Charset = ""
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.ContentType = "application/vnd.xls"
Dim stringWrite As StringWriter = New StringWriter()
Dim htmlWrite As HtmlTextWriter = New HtmlTextWriter(stringWrite)
gridData.RenderControl(htmlWrite)
Response.Write(stringWrite.ToString())
Response.End()
Internet Explorer无法从www.xyz.com下载abc.aspx Internet Explorer无法打开此网站。请求的网站不可用或无法找到。请稍后再试。
答案 0 :(得分:1)
删除第4行
Response.Cache.SetCacheability(HttpCacheability.NoCache)
这将是有效的。