Click here to Skip to main content
12,698,531 members (23,731 online)
Rate this:
Please Sign up or sign in to vote.
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
Posted 8-Oct-12 3:59am
gladiatron 8-Oct-12 10:13am
funny, i don't even get the "open link in new page" option in my right click menu. I only get it when i change the href of the rendered tag in Firebug to point to the page I want it to open from the original __doPostBack() that is the default that happens when u click a button. Can you show your markup and server side C#?
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

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>
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

better u ca use hipperlink button and menction tar

get=blank in the tag

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170118.1 | Last Updated 8 Oct 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100