| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
Adobe Reader and SSL
From within a SSL session a user can request to view the current information as a PDF document. In response the PDF document is streamed to the browser using ASP response.contenttype="application/pdf" followed by response.binarywrite binarydatastream.
The user is presented with a dialog indicating that they are leaving a secure area before the PDF viewer displays the PDF document in their browser. Is there any way to avoid the 'leaving a secure area' message? |
|
#2
|
|||
|
|||
|
Quote:
Basically, add the following line after your "response.contenttype..." line: Response.AddHeader("accept-ranges", "bytes") This will tell the browser to "accept" byte data, so it won't pop up the "unsecure" message. However, in my case this causes my page_load event to call twice! So everything takes twice as long to run, and generates twice the database inserts, etc... Anyone have a solution to this? Thanks, Squighound |
|
#3
|
|||
|
|||
|
Poor Monday Morning Testing
Almost a year later, I hope you found the solution for this problem, but seeing as no one posted a response.
I was having this exact problem trying to display reports from reporting services as pdfs. The application would call the page load/Page_Load method twice. Now I was working on this late Friday night and thought that I had not resolved the problem, but when I came in this morning it seems to be working fine. Maybe it was that dancing guy that wanted my first born? What was his name again? What I think fixed the problem was setting the contentType=application/pdf property on the page. Nevermind this didn't seem to help either just bad Monday morning testing. Last edited by Jason Dimmick : April 4th, 2005 at 01:03 PM. Reason: False results |
|
#4
|
|||
|
|||
|
WARNING! This is a Hack solution
Ok, let me start by saying I'm not proud of this, but it works.
I found a property that changes between the two page load events in the Request object. If you just return nothing for the first event the page just returns nothing so you must return some sort of pdf in order to make the page load twice. So, I created a small pdf. Wrote a small app to read out its bytes. Created a property byte[] property of those bytes. I then test for the Request property that I know changes, to see if it is the first time through. If it is the first time through I send back the small PDF that I have stored as a byte array. If not I return the results from reporting services. I plan on placing a global variable in the test. That way if for some reason this problem is fixed in a future version of IIS it will mean just changing a setting somewhere. |
![]() |
| Viewing: ASP Free Forums > Web Design > Multimedia > Adobe Reader and SSL |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|