We had a problem recently where one of the developers had changed a line of code from using HttpResponse.End
to using HttpApplication.CompleteRequest
when forcing a PDF to download in a similar fashion to the following:
https://stackoverflow.com/a/8590579/3856039
Doing so caused some PDF's to fail to download due to a non-breaking space issue so the code was changed back to using HttpResponse.End
.
However, in helping my colleague I was carrying out some research and I came across the following question: Is Response.End() considered harmful?
Which links to: https://blogs.msdn.microsoft.com/aspnetue/2010/05/25/response-end-response-close-and-how-customer-feedback-helps-us-improve-msdn-documentation/
Given what is documented in the MSDN blog post, it sounds like using HttpResponse.End
is the wrong approach, so I was wondering if it is even needed or whether there is a better approach?