在新标签页中打开链接 [英] Open link in new tab
本文介绍了在新标签页中打开链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好问候!!!
我想在新标签页面中打开一个链接,我使用了链接按钮,并将目标设置为空白。
< asp:LinkButton ID = LinkButton1 runat = < span class =code-keyword> server OnClientClick = window.document.forms [0] .target ='_ blank'; < span class =code-attribute> < span class =code-attribute> < span class =code-attribute> < span class =code-attribute> PostBackUrl = [与申请相同的页面] style = 颜色:白色; font-family:MyriadPro,Arial,Helvetica,sans-serif ;文本装饰:下划线; font-size:large; font-weight:bold; padding-left:30px; 文本 = 查看 >
完成此操作后。
上一个标签上的链接无效。
谢谢!
解决方案
你可以使用java脚本代码
< script 语言 = javascript 类型 = text / javascript >
函数Al()
{
window.open(http:// mpcongre ss.org);
window.focus();
}
将href位置设置为,即为空白,使用onclick事件调用函数Al()
< ul > < li > < a href = önclick = Al() > ; link < / a > < / li > < / ul >
您可以使用asp:Hyperlink而不是
asp:LinkButton
< asp:hyperlink id = HyperLink1 runat = 服务器 target = _ blank navigateurl = [与申请相同的页面] style = color:White; font-family:MyriadPro,Arial,Helvetica,sans-serif; text-decoration:underline; font-size:large; font-weight:bold; padding-left:30px; text = 查看 xmlns:asp = #unknown > < / asp:hyperlink > 跨度>
Hello greetings!!!
I want to open a link in new tab i used link button and also set target as blank.
<asp:LinkButton ID="LinkButton1" runat="server" OnClientClick="window.document.forms[0].target='_blank';" PostBackUrl="[Same Page with the appication]" style="color:White;font-family: MyriadPro,Arial, Helvetica, sans-serif;text-decoration:underline; font-size: large; font-weight: bold;padding-left:30px;" Text="View ">
After doing this.
the link on previous tab won't work.
Thank You!
解决方案
You can Use java script code
<script language="javascript" type="text/javascript"> function Al() { window.open("http://mpcongress.org"); window.focus(); }
set the href location to " ", that is blank, use onclick event to call function Al()
<ul><li><a href=" " önclick="Al()"> link </a></li></ul>
You could use aasp:Hyperlinkinstead of
asp:LinkButton
<asp:hyperlink id="HyperLink1" runat="server" target="_blank" navigateurl="[Same Page with the appication]" style="color:White;font-family: MyriadPro,Arial, Helvetica, sans-serif;text-decoration:underline; font-size: large; font-weight: bold;padding-left:30px;" text="View" xmlns:asp="#unknown"></asp:hyperlink>
这篇关于在新标签页中打开链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文