开发者

Silverlight - Close Browser Window

开发者 https://www.devze.com 2023-04-08 07:44 出处:网络
I have a Silverlight application that launches another Silverlight application in a new brows开发者_运维百科er window. The new Silverlight application has a button called \"Close\". When a user clicks

I have a Silverlight application that launches another Silverlight application in a new brows开发者_运维百科er window. The new Silverlight application has a button called "Close". When a user clicks "Close", I run the following code:

HtmlPage.Window.Invoke("close");

This code works on IE just fine. However, it does not work in Chrome. How do I write code that will close the window in both IE and Chrome?

Thank you!


It's a known issue in Chrome browser. To workaround it, insert the following line before you call "close":

HtmlPage.Window.Invoke("open", new object[] {"", "_self", ""} );
HtmlPage.Window.Invoke("close"); 
0

精彩评论

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