I don't think you can open a window in a new tab at the moment when browsers support CSS3 you will have the ability open a window in a new tab. This is written about in the W3C standards, you can see it here:
http://www.w3.org/TR/2004/WD-css3-hyperlinks-20040224/
Set Target to "_blank", Javascript will just base on IE 7 's setting. If IE 7 use open a new window as default setting. It will open a new window. if not, it will open a new tab.
Can this also be done for a Link button within a grid view? i.e something like this to open in a new tab rather than a new window...i tried this and it returned a new window instead of a new tab!!
i also tried changing the target to "_new" still no luck and i am uisng IE7 browser..any suggestions please?
raklos
Member
112 Points
282 Posts
make hyperlink open in new tab
Jan 19, 2008 02:57 PM|LINK
scott@elband...
Star
11346 Points
1865 Posts
Re: make hyperlink open in new tab
Jan 19, 2008 03:10 PM|LINK
I don't think you can open a window in a new tab at the moment when browsers support CSS3 you will have the ability open a window in a new tab. This is written about in the W3C standards, you can see it here: http://www.w3.org/TR/2004/WD-css3-hyperlinks-20040224/
Hong-Gang Ch...
All-Star
74696 Points
6768 Posts
Re: make hyperlink open in new tab
Jan 21, 2008 05:24 AM|LINK
Hi raklos,
Base on my experience, you can refer the following code to solve your problem:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="hyperlinkDemo.aspx.cs" Inherits="hyperlinkDemo" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>hyperlink Demo</title> <script language="javascript" type="text/javascript"> function openNewWindows(){ window.open("http://www.asp.net"); } </script> </head> <body> <form id="form1" runat="server"> <div> <asp:HyperLink ID="hlDemo" runat="server" onclick="openNewWindows()" style="cursor:pointer; text-decoration:underline;">HyperLink Demo </asp:HyperLink> </div> </form> </body> </html>If you have any feedback about my replies,please contactmsdnmg@microsoft.com.
Microsoft One Code Framework
RutuPrash
Participant
877 Points
294 Posts
Re: make hyperlink open in new tab
Jan 21, 2008 05:34 AM|LINK
just insert target="_blank" in that tag like this:
<asp:HyperLink ID="hyp" NavigateUrl="~/aboutus.aspx" runat="server" Text="click" Target="_blank"></asp:HyperLink>
Bye
Prashant.
nsrikanth23
Member
29 Points
8 Posts
Re: make hyperlink open in new tab
Jan 21, 2008 05:36 AM|LINK
Insert target property of hyperlink as target = "_blank"..
hope that solves the problem.
Priyasadiwal...
Participant
1443 Points
295 Posts
Re: make hyperlink open in new tab
Jan 21, 2008 06:48 AM|LINK
Hi raklos
yov can set Target Property of that Hyperlink to _blank
or if You are calling javascript on OnClick event then Write Window.open("Page to open")
Priya.
realfantasy
Contributor
2103 Points
309 Posts
Re: make hyperlink open in new tab
Jan 21, 2008 09:43 AM|LINK
<asp:HyperLink Target="_blank" ID="lnkBlogSite" NavigateUrl="http://realfantasy.wordpress.com" Text="My Blog Site" runat="server" />
if browser support TABs it will surely work
ketan.raval....
Member
486 Points
125 Posts
Re: make hyperlink open in new tab
Jan 21, 2008 09:55 AM|LINK
SET Property of hyper link
Target="_blank"
Letsnurture
Ketan's Leadership Blog
Ketan's Nurture Blog
lhp13888
Member
49 Points
23 Posts
Re: make hyperlink open in new tab
Mar 31, 2008 11:58 PM|LINK
Set Target to "_blank", Javascript will just base on IE 7 's setting. If IE 7 use open a new window as default setting. It will open a new window. if not, it will open a new tab.
http://www.powerjs.com
ShadowOfTheB...
Member
130 Points
68 Posts
Re: make hyperlink open in new tab
Jun 04, 2008 04:34 AM|LINK
Hi All,
Can this also be done for a Link button within a grid view? i.e something like this to open in a new tab rather than a new window...i tried this and it returned a new window instead of a new tab!!
i also tried changing the target to "_new" still no luck and i am uisng IE7 browser..any suggestions please?
<asp:gridview ID="gvbooks" runat="server">
<Columns>
<asp:TemplateField ItemStyle- horizontalAlign="Center">
<ItemTemplate>
<a id="lnkDetails" runat="server" target="_blank">details</a>
</ItemTemplate>
<asp:TemplateField>
</Columns>
</asp:gridview >
William shakespeare, Hamlet