0

I've got a page that presents a bunch of part numbers to my users. I want a new window to open when the user clicks on a part number. The MSDN page for NavigateURL seems to indicate that I just put Target="_blank" in the properties for the Hyperlink, but that just pops a new tab (in Chrome if it matters).

How do I get it to pop a new window instead of a new tab? I tried to delete the DataNavigateUrlFormatString property because it seemed extraneous, but it didn't like that and told me that "Target was not a valid option for a hyperlink", or something to that effect (if it's important I can get the exact error).

Here's my code:

<asp:HyperLinkField HeaderText="Part Number"
DataTextField="partNumber"
DataNavigateUrlFields="partNumber"
DataNavigateUrlFormatString="PartLookup.aspx?partNumber={0}"
NavigateUrl="PartLookup.aspx?partNumber={0}"
Target="_blank"/>
delliottg
  • 3,950
  • 3
  • 38
  • 52

1 Answers1

1

The browser being used decides how to handle being given a target="_blank", and you can not control whether it chooses to make a new tab or window.

You can use Javascript to force the opening of a new window, but I do not believe that can be done through your HyperLinkField directly.

See this issue for Javascript

dillius
  • 506
  • 4
  • 12
  • Thanks for that, I've been able to get it to open a new Window in IE (which is what the primary user of this feature will be using), so I can show her how to do that. – delliottg Oct 16 '17 at 19:28