In a particular scenario, a WebBrowser
control fails to trigger a NavigationComplete
or NavigationFailed
event handler.
Here's what should happen:
WebBrowser
and provides it a url to load an authentication web page.WebBrowser
control loads the url and renders the page.WebBrowser
control follows the redirect.NavigationComplete
event handler is attached to the control. When it finds a url pattern that indicates the redirect succeeded it executes an additional method.What actually happens:
After the user submits their credentials at step #3 the WebBrowser
renders a blank white page and doesn't trigger any event handlers. The code is listening for every navigation event handler provided by the WebBrowser
control.
What I've tried:
WebBrowser
works just fine O_oonTap
events to the WebBrowser
that checks the current url/navigates to another page to see if the control is somehow broken after the blank page error. The WebBrowser
responds correctly.WebView
control. The WebView
works just fine.Any suggestions? Has anyone experienced this control acting up like this? Does anyone know of a library that might solve this issue (commercial or open source). Does the Android bridge for Windows or the iOS bridge for Windows support windows phone 8?
Dave,
The WebBrowser control is designed to work directly in UI threads and, by what you said above, it is possible that you may be running it in a non-UI thread, a situation where unexpected behavior should be... expected.
If that is the case, you might try to turn the thread into a Single Threaded Apartment (STA) thread, as the apatment model is fairly more adequate for COM componentes (such as ActiveX components, in which class WebBrowser falls) and you can do it as follows:
yourThread.SetApartmentState(ApartmentState.STA);
For more information on STA threads, please refer to this page.
Since the WebBrowser control is an AciveX component, the contents of this page is also of relevance and points towads the same issue.
Hope it helps. ;)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With