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:
Instead, you can use:
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:

Add Feedback