0

I have got the HyperLinkField below, that's part of a gridview, and I want it to open in a new popup window in Chrome...

 <asp:HyperLinkField DataNavigateUrlFields="Site ID" HeaderText="Site ID" target="_blank" DataTextField="Site ID" SortExpression="Full ID" DataNavigateUrlFormatString="sitecard.aspx?id={0}" NavigateUrl="javascript:window.open('sitecard.aspx'), 'pop', 'width=300, height=100, left=100, top=100, resizable=no, scrollbars=no, toolbars=no, menubar=no" />

Problem is that the page is opened in a new tab. As far as I have understood, Chrome only opens in a new window (thus acting like a real popup) whether the action is a user generated one (like onclick() for instance).

How should I change the code to have the new window to act like a real popup in chrome?

Thanks for you help. Regards,

Luca S.
  • 63
  • 4
  • By "new popup window" do you mean a new browser window, or a popup within the current window? If the former, then just maybe the answer at [Google Chrome “window.open” workaround?](https://stackoverflow.com/a/47890462/1115360) will work. Would the latter be an option if Chrome still will not do what you want? – Andrew Morton Jun 23 '20 at 14:32
  • Not sure about the difference, I have to try to tell. How can I bind a javascript function to my current code? Currently the "NavigateUrl" parameter doesn't appear anywhere in the HTML source code of the page. – Luca S. Jun 23 '20 at 15:11
  • Does the `onClientClick` attribute work in an asp:HyperLinkField? – Andrew Morton Jun 23 '20 at 15:32
  • No onClientClick and no onClick unfortunately. – Luca S. Jun 23 '20 at 15:34

0 Answers0