如何从项目符号列表中打开新窗口 [英] how to open a new window from a bulleted list

查看:98
本文介绍了如何从项目符号列表中打开新窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我确实有一个指向项目符号的pdf文档链接列表.

Hallo,

I do have a bulleted list of links to pdf-documents.

<asp:BulletedList ID="lst_links" runat="server" DisplayMode="HyperLink"

    Target="_new">
</asp:BulletedList>



该列表动态地填充了项目(指向pdf文件的链接).现在,我想使用javascript在新窗口中打开文件(没有地址栏,工具栏,状态栏等).我该怎么做?



The list is filled with items (links to pdf-files) dynamically. Now I want to use javascript to open the files in a new window (without address bar, toolbar, status bar etc.). How can I do that?

推荐答案

<script language="JavaScript">
function load() {
var load = window.open('http://www.google.com','','scrollbars=no,menubar=no,height=600,width=800,resizable=yes,toolbar=no,location=no,status=no');
}
</script>




当您单击链接按钮时,将触发服务器端事件并在新页面中打开文件.

相反,如果您在类文件中编写Java脚本,例如

Hi,

When ur clicking on Link Button the server side event is fired and open file in the new page.

Instead if u write java script in the class file like

lnkbtn.attributes.add("OnClick","JavaScript:WinOpen();")



并在代码页中实现WinOpen()方法,如



and in the Code Page u implement WinOpen() method Like

function WinOpen()
{
var lnkbtn= document.getelementId("<%= lbkbtn.ClientID %>");
//Here u need to pass the file path as a value to the link button
path = lnkbtn.value;
//Other wise pass the path to the hidden field control in the page and read from there

//var hdnctrl =  document.getelementId("<%= hdnctrl.ClientID %>");
//path = hdnctrl.value;

var win = window.open(path, "newwin", "height=250,width=250,toolbar=no,scrollbars= no ,menubar=no");
} 



谢谢.........



Thanks.........


这篇关于如何从项目符号列表中打开新窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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