链接按钮点击新标签中的打开pdf文件 [英] Link button onclick open pdf file in new tab

查看:431
本文介绍了链接按钮点击新标签中的打开pdf文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我点击链接按钮会在文件夹内生成pdf(RDLC)文件,我想在服务器端链接按钮触发时打开该Pdf文件

解决方案

< blockquote>你设置目标为'_Blank'和



代码后面的获取路径使用Server.mapPath

然后Respose.Redirect( 你的路径)


 <   html  >  
< head >
< script type = text / javascript >
function openTab(th)
{
window.open(th.name,'_ blank');
}
< / script >
< / head >
< body >
< a onClick = openTab(this) href = name < span class =code-keyword> = PDF / Govt_Holiday-2014.pdf > 下载Pdf < / a >
< / body >
< / html >


I have Link Button when i click it will generate pdf(RDLC) file inside folder,i want to open that Pdf file when link button fire in server side

解决方案

You Have Set Target As '_Blank' and

code behind Get Path USing the Server.mapPath
and Then Respose.Redirect ("Your Path")


<html>
    <head>
        <script type="text/javascript">
            function openTab(th)
            {
                window.open(th.name,'_blank');
            }
        </script>
    </head>
    <body>
        <a onClick="openTab(this)" href="#" name="PDF/Govt_Holiday-2014.pdf">Download Pdf</a>
    </body>
</html>


这篇关于链接按钮点击新标签中的打开pdf文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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