[RESOLVED] Response.WriteFile returns the aspx page!
My code generates an excel file and should be sending it to the user for download. Instead, the user is getting the .aspx page as an .xls file! o.O
Can someone shed some light on this? Many thanks in advance
Response.ContentType = "application/x-msexcel";
System.IO.FileInfo fileToDownload = new System.IO.FileInfo(filename.ToString());
System.String disHeader = "Attachment; Filename=\"" + fileToDownload.Name + "\"";
It's not a bug, it's a feature!