Re: Page_Load event firing twice when loading PDF

From: bruce barker (nospam_brubar_at_safeco.com)
Date: 03/30/04


Date: Tue, 30 Mar 2004 09:54:23 -0800

this is by design. when IE downloads a content type that it uses external
viewer such as pdf, it does the following:

1) detects content type requires external viewer
2) re-requests the content with a special header to verify the content-type
3) loads the external viewier
4) passes the url to the viewer so the viewer can download the content

of course if you have anonymous turned off, there are a few more trips for
authenication.

-- bruce (sqlwork.com)

"andrei" <andrei.toma@era-environmental.com> wrote in message
news:e0qtjpmFEHA.2732@tk2msftngp13.phx.gbl...
> Hi Group,
>
> I'm having a problem with the Page_Load event firing twice when loading
and
> displaying a pdf.
>
> I've seen other people here encountered the same problem, but
unfortunately
> the discussion thread did not end with a positive answer/solution.
>
> (see thread with subject "Page_Load Event Fires Twice When Sending Down a
> PDF")
>
> In fact, I have another form, with an iframe element on it, which loads
this
> form.
>
> I'm using IIS 5.0, the above form is not the default form for the project
> and the SmartNavigation is set to false(this goes for both forms).
>
> Could anybody give some hints, please ?
>
>
>
> The code in Page_Load is as follows:
>
> *************************************
>
> Dim result() As Byte
>
> result = mReport.GetStream(strParams) ' here mReport is an object that
> loads the pdf from a database and returns it as a byte array
>
> Dim strContentType As String = ""
>
>
>
> strContentType = "application/pdf"
>
>
>
> Response.Clear()
>
> Response.ClearContent()
>
> Response.ClearHeaders()
>
> Response.ContentType = strContentType '"application/pdf"
>
> Response.AddHeader("content-length",
System.Convert.ToString(result.Length))
>
> Response.BinaryWrite(result)
>
> Response.Flush()
>
> Response.Close()
>
> **************************************
>
> Thank you,
>
> Andrei.
>
>
>
>



Relevant Pages

  • Re: No Word 2007 Viewer?
    ... I forget that sometimes because while I have PDF creating ... Word 2007 was used to create it in Word 2007 format. ... come out with a genuine Word 2007 viewer at some point. ... You simply can't access new Word 2007-only features unless you're ...
    (microsoft.public.word.conversions)
  • Re: Is There A PP Viewer For Mac?
    ... I downloaded the .exe file which should ... > with a PP slideshow produced on a Mac with OS X, ... install the viewer and what file to doubleclick to start the show. ... PDF doesn't support animations at all ...
    (microsoft.public.mac.office.powerpoint)
  • Re: No Word 2007 Viewer?
    ... There are even some decent freeware PDF makers out there, ... Word 2007 was used to create it in Word 2007 format. ... come out with a genuine Word 2007 viewer at some point. ... You simply can't access new Word 2007-only features unless you're ...
    (microsoft.public.word.conversions)
  • Re: No Word 2007 Viewer?
    ... Word MVP web site http://word.mvps.org ... PDF makers out there, I hear. ... if Word 2007 was used to create it in Word 2007 format. ... will come out with a genuine Word 2007 viewer at some point. ...
    (microsoft.public.word.conversions)
  • Re: java.security.AccessControlException issue
    ... because this site will be used to display answer sets for students. ... public class SampleReader extends Viewer { ... // Construct a acrobat object aka Acrobar Reader ... // to open a local or remote PDF file. ...
    (comp.lang.java.programmer)