LinkBut​​ton无法在新页面中打开并刷新 [英] LinkButton can not open in new page and refreshed

查看:70
本文介绍了LinkBut​​ton无法在新页面中打开并刷新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我的ASP.Net网站上有很多LinkBut​​ton,

但是当我按右键单击任何LinkBut​​ton并在新页面中选择打开链接时出现问题,

该页面将刷新并在同一页面中打开,

我不想将链接用作< herf =">< a>标记,因为我需要使用LinkBut​​tons

Hi guys,

I have many LinkButtons in my ASP.Net website,

but the problem when i press right click on any LinkButton and choose open link in new page,

the page is refreshed and open in the same page,

I do not want to use link as <a herf=""><a> tag, becasue i need to use LinkButtons

推荐答案

LinkBut​​ton执行HTTP POST操作,您不能在此处更改post target.这是为了显示HyperLink的外观,但其行为是的按钮.

相反,您可以使用 asp:HyperLink 控件(与< a herf =">< a>"标签不同)

您还可以将Target属性设置为在新窗口中打开.

示例代码
LinkButton executes HTTP POST operation, you cant change post target here.It is to give the appearance of a HyperLink but the behaviour of a Button.

Instead you can use the asp:HyperLink control (different from the "<a herf=""><a>"tag)

You can also set the Target property to open in new window.

Sample code
<asp:HyperLink ID="HyperLink1" Target=_blank NavigateUrl=''WebForm1.aspx''  runat="server">HyperLink</asp:HyperLink>


最好使用hipperlink按钮并指定tar

标签中的get = blank
better u ca use hipperlink button and menction tar

get=blank in the tag


这篇关于LinkBut​​ton无法在新页面中打开并刷新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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