Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open asp:HyperLink.NavigationUrl in a new tab

Is there a way to open an asp:HyperLink.NavigateUrl in a new tab and not change location of the current?

like image 998
Shimmy Weitzhandler Avatar asked Jul 28 '09 03:07

Shimmy Weitzhandler


People also ask

What is Hyperlink control in asp net?

ASP.NET Web Forms HyperLink. It is a control that is used to create a hyperlink. It responds to a click event. We can use it to refer any web page on the server. To create HyperLink either we can write code or use the drag and drop facility of visual studio IDE.


2 Answers

use <asp:HyperLink Target="_blank" /> actually depending on the users settings that may open a new window.

This works for a new tab in FF and Chrome, doesn't seem to work in IE (8), but this may depend on the doctype.

like image 190
Paul van Brenk Avatar answered Sep 22 '22 16:09

Paul van Brenk


<asp:HyperLink ID="HyperLink1"       runat="server"       NavigateUrl="http://yoursite.com"       Target="_blank">        This will work. </asp:HyperLink> 
like image 23
Himanshu Avatar answered Sep 18 '22 16:09

Himanshu