【问题标题】:asp.net open hyperlinkfield in new windowasp.net 在新窗口中打开超链接字段
【发布时间】:2017-04-12 23:17:40
【问题描述】:

我在网格视图中有一个超链接字段。截至目前,我正在使用 target="_blank",当我单击“路径”列中的超链接文本时,该链接会在新选项卡中打开。我希望链接在新窗口中打开。任何人都可以帮忙吗?

我正在使用 Visual c# 2015

这是我用来在我的 gridview 中定义列的代码:

    <Columns>
        <asp:BoundField DataField="id" HeaderText="id" SortExpression="id" />
        <asp:BoundField DataField="date" HeaderText="date" SortExpression="date" />
        <asp:BoundField DataField="timeOpen" HeaderText="timeOpen" SortExpression="timeOpen" />
        <asp:BoundField DataField="timeClose" HeaderText="timeClose" SortExpression="timeClose" />
        <asp:hyperlinkfield headertext="path"
            datatextfield="path"
            datanavigateurlfields="path"
            datanavigateurlformatstring="https://www.harris.com/{0}"
            target="_blank" />
    </Columns>

【问题讨论】:

标签: c# asp.net gridview hyperlink


【解决方案1】:
   <asp:HyperLink ID="HyperLink1"  NavigateUrl='<%# Eval("ID","pathurl.aspx?I={0}") %>' Target="_blank" runat="server">Path</asp:HyperLink>

【讨论】:

    【解决方案2】:
    <a href="http://wwww.google.com"  onclick="window.open('http://wwww.google.com', 'newwindow', 'width=300, height=250'); return false;"> Print</a>
    

    试试这个

    【讨论】:

    • 这应该去哪里?
    猜你喜欢
    • 1970-01-01
    • 2015-05-04
    • 2015-02-09
    • 1970-01-01
    • 2019-06-20
    • 1970-01-01
    • 1970-01-01
    • 2017-11-25
    • 1970-01-01
    相关资源
    最近更新 更多