for example, we navigating to http://www.ggg111.com, it\'s a error URL. but in WebBrowser it display a error page with this:
The webpage cannot be found HTTP 40
not sure about this but,.... try it,...
string check = webBrowser1.DocumentText; if (check.IndexOf("The webpage cannot be found") > 1) { MessageBox.Show("ERROR OCCURED"); //what else you want to do, do here!!! }
this will search for given text and if found will execute further code