0

I have a WPF application with a WebBrowser control inside.

When I navigate to a website, I would like to know if the page is online or not. I the page is not accessible, I would like to navigate to a local html error page...

How can I do it ?

The first solution I found is to do a WebRequest before navigating, but it require a additional website call... I would like to find an other solution.

I wanted to get the HTTP Status code of the page in the "navigated" event of the WebBrowser, but I found here that it's not possible qith a WebBrowser control because the WebResponse is always null...

Is there an other solution?

Gab
  • 1,861
  • 5
  • 26
  • 39

1 Answers1

0

This seems a common question, I added a solution here using the .Net NavigationService. Alternatives are also discussed.

Community
  • 1
  • 1
dave
  • 1,567
  • 2
  • 21
  • 34