首页 > 解决方案 > URL Not loading in a System.Windows.Forms.WebBrowser

问题描述

I'm using a System.Windows.Forms.WebBrowser control to load a webpage. My understanding is it is just a wrapper around Internet Explorer. I'm therefore struggling to understand why the web page loads ok in a desktop browser (IE 11) but not in the browser control.

The URL has looks as so:

http://subdomain.domain.co.uk/?argumentName=argumentValue

My question is, firstly, is that a valid url (format wise)? Can you have a '?' directly after the '/' as shown? My theory is this could be getting removed behind the scenes when using a desktop browser and not happening when using the browser control. Unfortunately I cannot test that theory as the web page is behind a firewall. At the moment I know nothing else about the location of the web page other than the url.

If that is a valid url, could anyone suggest reasons it would load in IE but not in the web browswer control?

To expand on how its not working, the request times out after 30 seconds. The NavigateError event is raised (status code for me is -2146697211, but that could well be different to status code they get. I cannot find that out until I deploy a dll with some logging info).

The webpage then displays as

The Navigation Error shown

标签: c#winformsbrowserwebbrowser-control

解决方案


推荐阅读