We've got an IFrame on a page (let's call that page DocViewer.aspx) the src of which is set to another page. Let's call that other page DocContent.aspx
ere's the page load on DocContent.aspx.vb:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'get pdf bytes from session
Dim pdfBytes As Byte() = CType(Session("PDFBytes"), Byte())
'remove pdf bytes from session
Session.Remove("PDFBytes")
With Response
' Set the response type to PDF
.ClearHeaders()
.Buffer = True
.ContentType = "application/pdf"
.AddHeader("Content-Disposition", "inline; filename=" & "midoc.pdf")
.AddHeader("Content-Length", (pdfBytes.GetUpperBound(0) + 1).ToString)
Response.OutputStream.Write(pdfBytes, 0, pdfBytes.Length)
.End()
End With ' response
End Sub
and here's the DocContent.aspx page in all it's glory:
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="DocContent" Inherits="OurCompany.OurNamespace.DocContent" %>
The reason we're using an IFrame is to alow us to host the PDF in a page that also runs some scripts and has some more controls on (if a certain condition is met, we pop up a modal dialog using the modal dialog extender ,but we've switched that behaviour off and the problem is still occuring). Not using an IFrame isn't a doable solution either. I've checked the security settings in IE and they're all set to allow IFrames to be dislayed.
Here's the problem then - on some testers PCs the page displays the pdf fine. On others we just get a blank page.
Just seen a machine that wasn't displaying start displaying when it was upgraded to IE7. This unfortunately is not a solution as we have to support anything down to IE5.5 :(
I'd be super grateful for any ideas anybody has.
I should also mention that these machines have no trouble when navigating to a page similar to DocContent directly (rather than being hosted in an IFrame).
Oh and thanks in advance for your help.