Display Pdf Stream on page load with Binary Write

Posted by Israfel on Stack Overflow See other posts from Stack Overflow or by Israfel
Published on 2010-03-08T15:47:16Z Indexed on 2010/03/08 15:51 UTC
Read the original article Hit count: 292

Filed under:
|
|

I have a pdf file being generated on the fly which I want to display inline on pageload, as below

Response.Clear()
    Response.AppendHeader("Content-Disposition", "inline; filename=_Bulk_Print.pdf")
    Response.ContentType = "application/pdf"
    Response.BinaryWrite(docData)
    Response.End()

If I put this in a click event it works perfectly but when on page load I Just get a blank aspx page despite the fact it's stepping through that code and the generation of the DocData no problem. Does anyone know the reason for this or a workaround, thanks for your help.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about vb.net