坚持浏览器的pdf视图 [英] Stuck in pdf view on browser

查看:86
本文介绍了坚持浏览器的pdf视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hii,



i在浏览器的pdf视图中,同时提供物理服务器的路径



我尝试过:



hii,

i am stuck in pdf view on browser while giving the path of physical server

What I have tried:

my code is

<pre>string FilePath = "~/pdfs/channel-hw list.pdf";




string embed = "<object data=\"{0}\" type=\"application/pdf\" width=\"900px\" height=\"600px\">";
        ltEmbed.Text = string.Format(embed, ResolveClientUrl(FilePath));





i想把文件路径作为物理服务器地址(例如\\servername\foldername\filename.pdf)。但它没有显示任何结果



i want to put filepath as physical server address(e.g. \\servername\foldername\filename.pdf). but it not showing any result

推荐答案

尝试使用 Server.MapPath方法 [ ^ ]

try using Server.MapPath Method[^]
string folder = Server.MapPath("pdfs");
           string filePath = System.IO.Path.Combine(folder, "channel-hw list.pdf");
           string embed = "<object data=\"{0}\" type=\"application/pdf\" width=\"900px\" height=\"600px\">";
           ltEmbed.Text = string.Format(embed,   filePath);


这篇关于坚持浏览器的pdf视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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