Click here to Skip to main content
15,895,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Comments
I.explore.code 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#?

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>
 
Share this answer
 
better u ca use hipperlink button and menction tar

get=blank in the tag
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900