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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Write PDF to New Window

Status
Not open for further replies.

JabbaTheNut

Programmer
Jul 29, 2002
176
US
I have used the following VB code from behind a web form to open a PDF file. This code writes the PDF file to the current browser window. How can I write the PDF to a new window? I am using ASP.Net.

VB CODE:

' Obtain the appid from the text box on the web form
Dim strAppID As String = MyTxtBox.Text

' Assemble the proper PDF file name using the above appid
Dim strPdfFile As String = "c:\MyPDFDirectory\" & strAppID & ".pdf"

' Write the PDF file to the web browser
Response.ContentType = "Application/pdf"
Response.WriteFile(strPdfFile)
Response.End() Game Over, Man!
 
What I would do is to transform your file path to an url and then I would use the:

Response.Redirect(strURL,false);

hope this works Daren J. Lahey
Just another computer guy...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top