开发者

MenuItem.NavigateUrl = Javascript results in opening two window, one null

开发者 https://www.devze.com 2023-02-26 06:01 出处:网络
I am using a .NET Menu control that I build dynamically. Some MenuItems are set to: javascript:window.open(开发者_StackOverflow社区\'{0}{1}\',\'_blank\',\'\');

I am using a .NET Menu control that I build dynamically. Some MenuItems are set to:

javascript:window.open(开发者_StackOverflow社区'{0}{1}','_blank','');

because I want these menu items to be opened in a new (popup) window. Example:

javascript:window.open('http://google.com','_blank','');

Without setting MenuItem.Target, this results in a new window with Google it, and my current window gets set to a content value of "null". The HTML source of the window is "null" - that's it.

If I set MenuItem.Target = "_blank" (it doesn't seem to matter what the value is), my base window is preserved, but I get a third window with contents = "null".

MenuItem.NavigateUrl = Javascript results in opening two window, one null

I am sure this is pretty simple, but I have tried all the permutations I can come up with.


javascript:void(window.open('http://google.com','_blank',''));
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号