0

I have been trying to have the user download an excel file via a download prompt. Everything works fine in firefox and IE7 + but it doesnt work in IE6. In IE6, it displays the name of the aspx page and downloads a blank page.

Here is my code Response.Clear(); string fileName = DateTime.Now.ToShortDateString() + "Leads.csv"; Response.Clear();

Response.AppendHeader("content-disposition", "attachment;filename=" + fileName); Response.ContentType = "application/vnd.ms-excel"; if (Session["LeadsSearchResults"] != null) { WriteLeads(Response.Output, GetTasks((IList)Session["LeadsSearchResults"])); } Response.Flush(); Response.End();

user107723
  • 105
  • 2
  • 6

1 Answers1

1

You need to remove slashes from the file name.

paulwhit
  • 8,719
  • 4
  • 29
  • 30