Re: Page_Load event firing twice when loading PDF
From: bruce barker (nospam_brubar_at_safeco.com)
Date: 03/30/04
- Next message: Pete Beech: "Re: memory leak (windows 2003, asp.net, sql2000)"
- Previous message: Phil: "printing problems in netscape 7.1 browser"
- In reply to: andrei: "Page_Load event firing twice when loading PDF"
- Messages sorted by: [ date ] [ thread ]
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.
>
>
>
>
- Next message: Pete Beech: "Re: memory leak (windows 2003, asp.net, sql2000)"
- Previous message: Phil: "printing problems in netscape 7.1 browser"
- In reply to: andrei: "Page_Load event firing twice when loading PDF"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|