通过单击数据列表中的超链接来打开新窗口 [英] open new window by clicking hyperlink inside Datalist

查看:124
本文介绍了通过单击数据列表中的超链接来打开新窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Datatable中有数据,并将其绑定到Datalist.在数据列表中是HyperLink.现在,我要在单击Hyperlink时打开一个新窗口.而且我还希望在新窗口中使用"Jobid"(Datatable中的列).

我的代码是这种类型的...

I have data inside Datatable and I bind it to Datalist. Inside datalist their is HyperLink.Now I want to open a new Window on clicking Hyperlink. And I also want "Jobid"(Column inside Datatable) in New Window.

My code is this type...

<asp:DataList ID="dljobs" runat="server" Width="100%"  > <

ItemTemplate>  <table width="100%" style="border-collapse:collapse;">
   <tr>


<td colspan="2" class="links">
 <asp:HyperLink ID="hprJobtitle" runat="server" Text='<%#Eval("Job_Title") %>'  CssClass="links" Font-Size="14px"></asp:HyperLink>

推荐答案

<asp:hyperlink id="hprJobtitle" runat="server" target="_blank" text="<%#Eval("Job_Title") %>" cssclass="links" font-size="14px" navigateurl="<%#Eval("Job_id","JobSummary.aspx?ID={0}") %>" xmlns:asp="#unknown"></asp:hyperlink>


尝试一下
javascript文件
Try this
javascript file
function PopUpPassword(ref) {
        var strFeatures = "toolbar=no,status=no,menubar=no,location=no,scrollbars=no,resizable=no,height=220,width=280,left=300,top=300";
        newWin = window.open(ref, "Page_Title", strFeatures);
        newWin.opener = top;
    }


写在正文中


write in body

<a href="javascript:PopUpPassword('pagename.aspx')" title="New Window">New Window</a>


这会弹出.


This will come as pop up.


这篇关于通过单击数据列表中的超链接来打开新窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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