MenuItem.NavigateUrl = Javascript results in opening two window, one null
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".
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',''));
精彩评论