target _blank无法在按钮中工作

时间:2015-04-04 12:00:51

标签: html asp.net gridview

我想在新标签页中打开如何更改我的代码以在新标签页中打开链接的链接

 <button onclick="location.href='<%#Eval("ReportLinks")%>'," title='<%#Eval("ReportLinks")%>'> Link</button>

2 个答案:

答案 0 :(得分:0)

t T使用较小的target而不是大写<ItemTemplate><a href='LinkDetails.aspx?val1=total'><asp:Label ID="lblUsername" Fore-color="#1A0DAB" ToolTip="all links report" runat="server" Text='<%# Eval ("Total") %>' target="_blank"> </a></asp:Label> </ItemTemplate> ,如下所示:

{{1}}

答案 1 :(得分:0)

  <asp:TemplateField HeaderText="Total Unique Links">
                        <ItemTemplate><a href='LinkDetails.aspx?val1=total' Target="_blank"><asp:Label ID="lblUsername" ForeColor="#1A0DAB" ToolTip="all links report" runat="server" Text='<%# Eval ("Total") %>' ></asp:Label>
                            </a>
                        </ItemTemplate>