cannot open new window in browser with PDF content

B

bbulsara23

Hi, this has been asked so many times before but I cannot get an answer
that works.


So I'm asking again.


I am using .Net 1.1 on a Windows XP Pro.


What I want is for the browser to display a PDF "inline" in the browser
in a "new" window. The PDF comes from a database and I stream it to the
browser. The key points are "inline" and "new window". My code works
but it displays the PDF in the current window.

Here is an example of my VB.NET code. This code is executed on a
postback button click on the server. When I remove the comments, which
is how I think you create a new browser window, the browser displays
junk. I would like it to display my PDF document in a new window. Any
ideas on how I can get this to work?

Thank you
Barry


' Response.BufferOutput = True
' Response.ClearHeaders()
' Response.ClearContent()
' Response.ContentType = "text/plain"
' Response.AddHeader("Content-Type", "text/plain")
' Response.Write("<script
language=""javascript"">window.open()</script>")


Response.ContentType = "application/pdf"
Response.AddHeader("content-disposition", "inline; filename=cv.pdf")
Response.AddHeader("Content-Type", "application/pdf")
Response.WriteFile(myCV.ToString())
Response.Flush()
Response.Close()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top