如何在新PAGE中打开pdf [英] how to open pdf in new PAGE

查看:97
本文介绍了如何在新PAGE中打开pdf的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

pdf文件在gridview控件中,我想使用链接按钮打开此pdf到其他NEW PAGE ...怎么办?

解决方案

添加此项在链接按钮的HTML标记中

 OnClientClick =javascript:window.open(''http://www.codeproject.com'');





如果你想从服务器端添加这个



 lnkBut​​ton.Attributes.Add(onclick,window.open(''http://www.codeproject.com'');); 


使用gridview模板字段

< asp:templatefield headertext =   PDF >  
< itemtemplate>
< a href = <%#Eval( pdfurl )%> target = _ blank >
打开
< / a >
< / itemtemplate >
< itemstyle horizo​​ntalalign = 中心 verticalalign = 顶部 />
< / asp:templatefield >


pdf file is in gridview control,,i want to open this pdf to other NEW PAGE using link button...how to do?

解决方案

Add this in the HTML tag of link button

OnClientClick="javascript:window.open(''http://www.codeproject.com'');"



if you want to add this from server side

lnkButton.Attributes.Add("onclick", "window.open(''http://www.codeproject.com'');");


Use gridview template field

<asp:templatefield headertext="PDF">
                            <itemtemplate>
                                <a href="<%#Eval("pdfurl")%>" target="_blank">
                                Open
                                </a>
                            </itemtemplate>
                        <itemstyle horizontalalign="Center" verticalalign="Top" />
                        </asp:templatefield>


这篇关于如何在新PAGE中打开pdf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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