WebBrowser control
-
I am using WebBrowser control in VC++ project. WebBrowser loads page form Intranet Server. I don't want to show message like "The page cannot be displayed" in case server is down. I want to show some local html page which will be stored on client computer. Does anyone know how to catch event when page is not successfully loaded from server? Thanks Sanjeev.
The page cannot be displayed message is a resource in IE, so you can't change it directly. I'm not sure DownloadComplete or DocumentComplete would be fired until after the error page is loaded. You may have to send an http request to the server first to see if it returns an error, then show your page. Like it or not, I'm right.
-
Like Mark said but I'd use the DocumentComplete Event in case frames are being used instead. I actually like to verify with the changing Title text as well, for more specific errors. Regardz Colin J Davies
Sonork ID 100.9197:Colin
More about me :-)
From MSDN: DocumentComplete event when the document has completely loaded and the READYSTATE property has changed to READYSTATE_COMPLETE. NavigateComplete2 The document might still be downloading (and in the case of HTML, images might still be downloading), but at least part of the document has been received from the server, and the viewer for the document has been created. The latter method would allow you to determine if the correct page were loaded(or loading) without having to wait for the READY_STATE to be set. You'll also note from the documentation that NavigateComplete2 is used for frames also.
-
The page cannot be displayed message is a resource in IE, so you can't change it directly. I'm not sure DownloadComplete or DocumentComplete would be fired until after the error page is loaded. You may have to send an http request to the server first to see if it returns an error, then show your page. Like it or not, I'm right.
Jason Henderson wrote: Like it or not, I'm right. Like it or not your wrong. Using the NavigateComplete2 method you do not need to send a request first to see if an error occurs. In my opinion that would be a very poor technique. Depending on the server configuration, error messages can be changed so it is possible from that end to change the 404 error page.
-
Jason Henderson wrote: Like it or not, I'm right. Like it or not your wrong. Using the NavigateComplete2 method you do not need to send a request first to see if an error occurs. In my opinion that would be a very poor technique. Depending on the server configuration, error messages can be changed so it is possible from that end to change the 404 error page.
>Depending on the server configuration, error messages can be changed so it >is possible from that end to change the 404 error page. what if server is not responding??? NavigateComplete2 method is called after the document is loaded (and displayed). I don't want the "error page" to be displayed at all.
-
Jason Henderson wrote: Like it or not, I'm right. Like it or not your wrong. Using the NavigateComplete2 method you do not need to send a request first to see if an error occurs. In my opinion that would be a very poor technique. Depending on the server configuration, error messages can be changed so it is possible from that end to change the 404 error page.
Mark Nischalke wrote: Like it or not your wrong. Apparently, you don't like my sig. You're not the first. ;P Like it or not, I'm right.
-
Jason Henderson wrote: Like it or not, I'm right. Like it or not your wrong. Using the NavigateComplete2 method you do not need to send a request first to see if an error occurs. In my opinion that would be a very poor technique. Depending on the server configuration, error messages can be changed so it is possible from that end to change the 404 error page.
Mark Nischalke wrote: Like it or not your wrong. Apparently, you don't like my sig. You're not the first. ;P Mark Nischalke wrote: In my opinion that would be a very poor technique. It was just an idea because, at the time I did not know what event to use. Like it or not, I'm right.
-
Jason Henderson wrote: Like it or not, I'm right. Like it or not your wrong. Using the NavigateComplete2 method you do not need to send a request first to see if an error occurs. In my opinion that would be a very poor technique. Depending on the server configuration, error messages can be changed so it is possible from that end to change the 404 error page.
Mark Nischalke wrote: Like it or not your wrong. Apparently, you don't like my sig. You're not the first. ;P Mark Nischalke wrote: In my opinion that would be a very poor technique. It was just an idea because, at the time I did not know what event to use. Mark Nischalke wrote: Depending on the server configuration, error messages can be changed so it is possible from that end to change the 404 error page. This is not what he wants. Like it or not, I'm right.
-
Jason Henderson wrote: Like it or not, I'm right. Like it or not your wrong. Using the NavigateComplete2 method you do not need to send a request first to see if an error occurs. In my opinion that would be a very poor technique. Depending on the server configuration, error messages can be changed so it is possible from that end to change the 404 error page.
Whoa, that was wierd. Like it or not, I'm right.
-
I am using WebBrowser control in VC++ project. WebBrowser loads page form Intranet Server. I don't want to show message like "The page cannot be displayed" in case server is down. I want to show some local html page which will be stored on client computer. Does anyone know how to catch event when page is not successfully loaded from server? Thanks Sanjeev.
I think the NavigateError event is what you need. new window Like it or not, I'm right.
-
I think the NavigateError event is what you need. new window Like it or not, I'm right.
Like it or not, u'r right. ;) Thanks for the answer ! I guess it should solve my problem..
-
>Depending on the server configuration, error messages can be changed so it >is possible from that end to change the 404 error page. what if server is not responding??? NavigateComplete2 method is called after the document is loaded (and displayed). I don't want the "error page" to be displayed at all.
Read the above reply when the NavigateComplete event is recieved the page can still be downloading elements.