A
andrei
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.
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.