从asp.net页面打开PDF [英] open pdf from asp.net page

查看:104
本文介绍了从asp.net页面打开PDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有PDF,我想从ASP.net项目中打开。我不想导航到PDF,但我想保留当前页面打开,但,当用户点击该链接时,我想在另一个页面打开PDF文件。

I have PDF that I would like to open from ASP.net project. I don't want to navigate to the PDF, but I want to keep the current page opened but when a user clicks on the link, I want to open the PDF file in another page.

推荐答案

您可以在新窗口中打开PDF:

You could open the PDF in a new window:

 <asp:HyperLink  Target="_blank" runat="server" ID="linkBarPdf" Text="Open Bar PDF"
                 NavigateUrl="~/foo/bar.pdf">

这不会的主机的PDF格式虽然,而是成为了由本地计算机的浏览器执行该文件。这可能是一个浏览器插件,也可以是浏览器之外。

This won't host the PDF though, but rather serve up the file for execution by the local machine's viewer. That COULD be a browser plug-in, or it could be outside of the browser.

这篇关于从asp.net页面打开PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆