Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open a PDF file

Status
Not open for further replies.

kferrara

Programmer
Jan 17, 2003
2
US
I have a PDF file that needs to open with a command button in ASP.net. When the command button is clicked there is code that must run BEFORE the PDF file is opened. The problem is (and I've searched and searched) I don't know the ASP.net code to actually open the PDF file. Does anybody know this? THANKS!

Karen
 
You could try this

With Response
.ClearContent()
.ClearHeaders()
.ContentType = "application/pdf"
.WriteFile("c:\mypdf.pdf)
.Flush()
.Close()
End With

Have you tried redirecting to the PDF url?
 
Thanks, I'll try your code. Actually, I'm using a server.transfer but to a different page. I want my asp page to transfer to a different page, but based on the code in the first page, a window needs to open up with a pdf file in it. The name and location of the pdf file is derived from a database stored procedure (not hard coded).

Karen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top