views:

371

answers:

1

I have a WPF application and I'm using the WebBrowser control to display some content from a public website.

Sometimes in weird edge cases when the network connectivity is flakey, the web browser will show the "This program cannot display the webpage" error page. Is there some way to listen to the WebBrowser to detect when this occurs, so I can load a placeholder?

A: 

In the Navigated event arguments, you can access the WebResponse, so you can access the HTTP response code.

Thomas Levesque
My app only calls refresh() on my browser control and it seems the Navigated event never gets fired after the first initialization. Does refresh() not have an event I can listen to?
Jippers
Apparently not... It's weird that Refresh doesn't trigger Navigated, it looks like a bug
Thomas Levesque
I'm having a similar issue where in I'm not able to access the HTTP headers available in WebResponse. http://stackoverflow.com/questions/1956590/how-to-get-the-response-headers-while-the-user-navigates-from-page-to-page
Trainee4Life