Problem with Streaming PDF after moving to IIS7

If, after moving to an IIS7 server, streaming PDF files no longer work in your application--or, more specifically, the browser produces a blank page or a "page not found," you may need to make the following adjustment in your code:

The following will no longer work correctly in IIS7:
Response.Flush()
Response.Close()
Instead, you can use:
Response.End()
Here's why:

Using Response.Flush() & Response.Close() won't correctly close.  Using Response.End(), on the other hand, will call Response.Flush() and then end execution of the page correctly (and, just as importantly, gracefully). 

Alternatively, you may be able to use:
HttpContextCurrent.ApplicationInstance.CompleteRequest()

Add Feedback