I have a webpage to download a excel in vb.net. The excel is generated from multiple xml files. There is no problem in the download of excel it is working fine. Once the download is completed I need to reload the entire page. The code i use to download the excel file is
With HttpContext.Current.Response
.ClearContent()
.AddHeader("Content-Disposition", "filename=a.xls;")
.ContentType = "application/vnd.ms-excel"
.Charset = "UTF-8"
.ContentEncoding = System.Text.Encoding.UTF8
.Write(oXMLDataMS.XSLTransform(sPath, oArgs))
.Flush()
Once after the download got completed i tried to reload the page using Response.Redirect(Request.RawUrl)
but it provides an error like http header is already sent. So, we can’t redirect. But I need to reload the page after excel got downloaded.
I tried to add reload using Response.Redirect(Request.RawUrl)
but it didn’t worked and provided error http header is already sent.
kishore Kumar P is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.