Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WebBrowser control: Navigation to the webpage was canceled

Setup

  • Windows 8 (full) tablet
  • .NET 2.0 application

I'm working on a project in which 4 WebBrowser controls are navigating to some webpage simultaneously when the application is loaded. The webpages have the same HTML, but are coming from different web servers.

The problem is that some of those pages display a "Navigation to the webpage was canceled" message in the WebBrowser control. This only happens when the application starts. I have implemented the solution described here to get the status code returned and weirdly enough, it is a 200 = OK status.

When I then refresh the page, it suddenly works correctly. I have suspicions that the problem might be caused by the simultaneous navigations, but I have no idea how I could verify that.

Any ideas?

like image 447
Gabriel G. Roy Avatar asked May 07 '13 15:05

Gabriel G. Roy


People also ask

What is WebBrowser control?

The WebBrowser control provides a managed wrapper for the WebBrowser ActiveX control. The managed wrapper lets you display Web pages in your Windows Forms client applications.


1 Answers

Alright, so I ended up firing a navigation and waiting for it to complete before doing the next one and I haven't encountered the problem since. It was a problem that didn't need a fancy solution, and we didn't have time to dig deeper, so we went with that.

like image 118
Gabriel G. Roy Avatar answered Nov 10 '22 22:11

Gabriel G. Roy