Target_Blank不适用于链接按钮我正在为Share Point 2013开发应用程序 [英] Target_Blank Is Not Working For The Link Button I Am Working On Apps For Share Point 2013

查看:135
本文介绍了Target_Blank不适用于链接按钮我正在为Share Point 2013开发应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<nav>
    <ul id="main-nav" class="clearfix">
<li>
   <asp:LinkButton runat="server" ID="lbtnHome" Text="Home" OnClick="lbtnHome_Click" ></asp:LinkButton></li>

instead of that i try this:

<li>
    <asp:LinkButton runat="server" ID="lbtnHome" Text="Home" OnClientClick="window.document.forms[0].target='_blank';" </asp:LinkButton></li>

but not working

推荐答案

我不确定您的LinkButton中是否存在语法错误,或者只是发布了摘录,不过您可以尝试以下操作:
I''m not sure if you have a syntax error in your LinkButton or was it just a problem with posting the snippet, nevertheless you can try this:
<asp:LinkButton runat="server" ID="lbtnHome" Text="Home" OnClientClick="window.document.forms[0].target='_blank';" />


或使用它:


Or use this:

<asp:HyperLink ID="hlHome" runat="server" NavigateUrl='~' Target="_blank">Home</asp:HyperLink>


这篇关于Target_Blank不适用于链接按钮我正在为Share Point 2013开发应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆