Create an internediate ASPX page that is returned. The intermediate page
would use an HttpRequest to attempt to download the PDF file. If it gets
back a 404 status code, it returns a regular HTML response indicating that
the file is not found, or whatever you wish to say. Otherwise, it sets the
Response.ContentType to "application/pdf" and uses Response.BinaryWrite to
write the PDF file back to the client browser.
--
HTH,
Kevin Spencer
Microsoft MVP
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
"pamela fluente" <pa***********@libero.itwrote in message
news:11**********************@g4g2000hsf.googlegro ups.com...
>
I have placed a button on a page to open a pdf stored on another
site.
When the user clicks on the button I do a Redirect to the pdf URL
... and this seems to work fine.
Question: is this the best way to do that ?
In case the PDF file, http://My.server.com/MyPdf.pdf is not on the
server
how can I detect this condition within the program and inform the
user, instead of letting
him to receive an error page ?
-P