LinkButton open new window tab
<asp:LinkButton ID="ln开发者_运维知识库kbtnMoreTagRules" runat="server"
CommandName='<%#Eval("Value")%>'
CommandArgument='<%# string.Format("{0}||||{1}", Eval("Tag"),
Eval("TagAppearance"))%>'
OnCommand="lnkbtnMoreTagRules_Command">Več pravil</asp:LinkButton>
I want to close current window tab and open new one.
How can i open a new window tab with linkbutton. target="_blank"
not helping.
As link button is posted back, so it cannot be used for a GET request. instead use HyperLink Class
LinkButton
works like a Button
and does not have a Target
attribute. Use a HyperLink
instead and set the Target
.
You need something like this
<asp:LinkButton id="LinkButton1" runat="server" onClientClick="window.open('http://asp.net');"
I doubt we have any foolprrof code to open link in tabs because most of the browser activities are totally under the control of users. User can change thier browser settings in the way they wanted to behave.
There is nice discussion related to this in below thread, it will be interesting for you,
http://www.dynamicdrive.com/forums/archive/index.php/t-19843.html
精彩评论