通过单击数据列表中的超链接来打开新窗口

问题描述:

我在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.