开发者

ASP.Net :couldn't display pdf file new tab in browser

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜