I am having an issue with (what I think is) the Response.WriteFile method in an ASP.NET/VB Web Forms application (which targets .NET 2.0) in IE 10 on a production server. Basically, this code has been in place and has been working great for many years until IE 10. Now, it works fine when I test it locally via Visual Studio, but when it's on a production server (Server 2008 R2, IIS 7), I get an error that the file cannot be downloaded. When I force it, I get a corrupt PDF. I'm using Crystal Reports X to generate the PDF. Anyone who is willing to help me with the right verbiage to research this issue will get my undying gratitude! I've tried all the compat modes of IE 10 with every variety. I've updated the browser definition files in my App_Browsers folder per Scott Hanselman http://www.hanselman.com/blog/BugAndFixASPNETFailsToDetectIE10CausingDoPostBackIsUndefinedJavaScriptErrorOrMaintainFF5ScrollbarPosition.aspx. As a still relative newbie developer, I'm not sure what I'm missing with how this works on IE 10 via VS but doesn't work when I put it in production.
Here is the code snippet in question:
...
Response.ContentType = "application/pdf"
Response.AddHeader("content-disposition", "attachment; filename=ThisReport_" & Server.UrlEncode(Me.ReportName.Text & "_" & Now.Month.ToString() & "_" & Now.Day.ToString() & "_" & Now.Year.ToString()) & ".pdf")
Response.WriteFile(strFileName)
...
Thank you in advance for any help, guidance, or direction you can offer in solving this issue. I have this sprinkled in many places in my application, so finding a root-level fix would be preferable to fixing it in every place where it appears. Unfortunately, upgrading to .NET 4.5 is not currently an option.