Hi All!
I have encountered PDF file in web form(.aspx).When I running the page usually display open/save dialog box pdf file.Actually,When I click link,I want to display pdf format in new tab in browser. What should I do?
Thanks in advance.
Hi All!
I have encountered PDF file in web form(.aspx).When I running the page usually display open/save dialog box pdf file.Actually,When I click link,I want to display pdf format in new tab in browser. What should I do?
Thanks in advance.
You have to fiddle with the "Content-Disposition" of the response header.
This SO post will be a better guide rather than me copy and paste everything.
Content-Disposition:What are the differences between “inline” and “attachment”?
UPDATE:
After reading your post again, I think I haven't address your question fully.
For the PDF to be displayed in a new tab/window, the hyperlink that links to the aspx that generates the PDF needs to target to a "_blank" or another target name. E.g.
<a href="some.aspx?some=query" target="_blank" ...>Link text</a>
You will the have to work on the response header as mentioned above.