views:

23

answers:

1

Hello!
I'm using WebBrowser control to allow user navigate to intranet web-portal and keep user in c# desktop application. In some cases user can clicks on link on html-page and child window with WebBrowser control opens(to do that, I subscribed to NewWindow event on parent WebBrowser control).
There is "Close" button on child window's page. It like like that:
<input type="button" name="closeButton" onclick="window.close()">
When user clicks on this button window with parent BrowserControl closes(without rising close/closing events) and child window becomes hanging.

But if we do same steps in IE6 - everything works fine.
Any propositions?
Thanks in advance.

A: 

Well, problem was solved, but in a bit dirty way: after opening popup window I find "closeButton" and erase code in its "onclick" event and then I attach event handler to "onclick" event(api allows to do that), which contains code, that closes popup window through winforms api manually;

alexb
What's more, I've found great solution on Mauricio Rojas Blog http://blogs.artinsoft.net/mrojas/archive/2009/05/21/webbrowser-control-and-window-close.aspx . It solved all problems.
alexb