Reputation: 3156
I am getting an error while exporting data to an excel sheet.
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 cannot download abc.aspx from www.xyz.com.
Internet explorer was not able to open this internet site.The requested site is either unavailable or cannot be found.Please try again later.
Upvotes: 0
Views: 927
Reputation: 26
Remove the line no 4
Response.Cache.SetCacheability(HttpCacheability.NoCache)
It will be work.
Upvotes: 1