C# 打开一个新选项卡并单击链接
因此,使用下面的链接,当用户单击“条款和条件”时,我希望T&C页面在单独的浏览器中打开。ATM it会重新加载带有T&C页面的浏览器。我以为“空白”打开了一个新标签C# 打开一个新选项卡并单击链接,c#,html,asp.net,C#,Html,Asp.net,因此,使用下面的链接,当用户单击“条款和条件”时,我希望T&C页面在单独的浏览器中打开。ATM it会重新加载带有T&C页面的浏览器。我以为“空白”打开了一个新标签 <p> Accept the <a href="~/TermsAndConditions" target=\"_blank\"> <span class="big-red">Terms and Conditions</span> </a> &l
<p>
Accept the <a href="~/TermsAndConditions" target=\"_blank\">
<span class="big-red">Terms and Conditions</span>
</a>
</p>
接受
您无法在单独的浏览器中打开新选项卡
在单独的浏览器中打开一个新选项卡是不可能的,我假定您指的是同一浏览器的一个新窗口
您不需要\“
转义qoutes
请注意,一旦进入qoutes,您需要逃离qoutes,例如:
"<a href=\"href\"></a>"
在JS文件中,如下所示:
function newwin () {
window.open("link"); // ~/termsandconditions
}
PS,target=“\u blank”
会打开一个新选项卡
但是,
target=“\u blank”
会打开一个新选项卡!:)这样就可以了。是的,但是为什么要转义引号呢?请查看
onclick="newwin()" // in the a tag
function newwin () {
window.open("link"); // ~/termsandconditions
}