469,631 Members | 1,776 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,631 developers. It's quick & easy.

cannot open new window in browser with PDF content

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()

Jan 10 '06 #1
1 9455
Replied in the other group. Do not multiple post, cross post instead.
<bb********@hotmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
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()

Jan 10 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by rathnesh | last post: by
2 posts views Thread by venkatesh | last post: by
4 posts views Thread by simon lee | last post: by
10 posts views Thread by David McCulloch | last post: by
29 posts views Thread by wayne | last post: by
5 posts views Thread by mike | last post: by
7 posts views Thread by anthony.turcotte | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.