在ASP.NET中如何在新标签页中打开超链接

16

我在网页上有一个超链接,希望在单击时它能自动打开到一个新的标签页,该怎么做?如果不可能实现,我也可以接受在新窗口中打开。

答案: link text
6个回答

34

我正在使用Chrome,所以其他浏览器并不会影响我,只是一个小项目。 - JaredH20
在这种情况下,我相信<a target="_blank">就足够了。 - Curtis

14

语法如下:

<a href="http://www.someurl.com" target="_blank">

这将在新页面或选项卡中打开页面,具体取决于浏览器配置。


5

添加

 target="_blank" in your link. 

如果您希望整个页面上的链接在新标签页中打开,可以使用以下方法。
<head>
 <title></title>
 <base target="_blank"/>
</head>

3

CSS3提供了一个target-new属性,您可以指定window | tab | none

If a user wanted to have new windows open in new tabs instead, she could use the following user style sheet to do so:

* { target-new: tab ! important }

截至2013年9月,任何主要的浏览器都不支持这个属性。http://www.w3schools.com/cssref/css3_pr_target-new.asp - tggm

3
请使用以下内容。
<asp:HyperLink ID="hplStandard" runat="server"  ForeColor="Green"  
 Font-Bold="True" Target="_blank">Standard Report</asp:HyperLink>

2

将属性Target设置为_blank


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接