Click here to Skip to main content
12,073,325 members (68,892 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# VB ASP.NET HTML VB.NET
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
Comments
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
 
good
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>
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

better u ca use hipperlink button and menction tar

get=blank in the tag
  Permalink  

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
Web02 | 2.8.160208.1 | Last Updated 8 Oct 2012
Copyright © CodeProject, 1999-2016
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