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