I have a problem when I use Response.AddHeader
. Firefox and Chrome work fine (They show the popup and download the file), but not in IE, where it only opens a blank popup and not do anything like download a file or show a prompt. The popup title is "-- webpage dialog
".
My code is below:
byte[] bRpt = ExportReportYoStream(rptMain, ExportFormatType.Excel);
Response.ClearHeaders();
Response.Clear();
Response.ContentType = "application/vnd.ms-excel";
Response.AddHeader("content-disposition", "attachment;filename=Test Document.xls");
Response.BinaryWrite(bRpt);
Response.Flush();
Response.End();
I have also tried many changes like:
Response.ContentType = "application/Save";
Response.ContentType = "application/octet-stream";
and many more as I can find on the internet.