Article ID: 272095 - Last Review: November 5, 2003 - Revision: 4.0

PRB: NavigateComplete2, DocumentComplete Events Pass Incorrect URL Parameter

System TipThis article applies to a different operating system than the one you are using. Article content that may not be relevant to you is disabled.
This article was previously published under Q272095
Expand all | Collapse all

SYMPTOMS

When you try to browse to a Web site and are redirected to a res:// protocol error page, the URL parameter of the NavigateComplete2 and DocumentComplete events, as well as calls to the get_LocationURL method, may reflect the intended destination and not the error page URL.

For example, if you try to browse to http://www.someservername.com/nopagehere.htm and encounter "The page cannot be found" error, the URL parameter of the NavigateComplete2 and DocumentComplete events contains the following URL:
http://www.someservername.com/nopagehere.htm
and not:
res://C:\WINNT\system32\shdoclc.dll/http_404.htm#http://www.someservername.com/nopagehere.htm
Calling get_LocationURL (or accessing the LocationURL property) returns the same value.

This differs from previous versions of Internet Explorer.

RESOLUTION

To retrieve the actual URL, you can use the document.location.href property or IHTMLDocument2::get_location followed by IHTMLLocation::get_href in Microsoft Visual C++.

STATUS

This behavior is by design and allows you to match up BeforeNavigate2 and NavigateComplete2 or DocumentComplete events more easily.

REFERENCES

For additional information, see the following Microsoft Developer Network (MSDN) Web Workshop sites:
IHTMLLocation::get_LocationURL Method
http://msdn.microsoft.com/workshop/browser/webbrowser/reference/IFaces/IWebBrowser2/get_LocationURL.asp (http://msdn.microsoft.com/workshop/browser/webbrowser/reference/IFaces/IWebBrowser2/get_LocationURL.asp)

NavigateComplete2
http://msdn.microsoft.com/workshop/browser/webbrowser/reference/events/NavigateComplete2.asp (http://msdn.microsoft.com/workshop/browser/webbrowser/reference/events/NavigateComplete2.asp)

DocumentComplete2
http://msdn.microsoft.com/workshop/browser/webbrowser/reference/events/DocumentComplete.asp (http://msdn.microsoft.com/workshop/browser/webbrowser/reference/events/DocumentComplete.asp)

APPLIES TO
  • Microsoft Internet Explorer 5.5
Keywords: 
kbdhtml kbprb kbwebbrowser KB272095
Retired KB ArticleRetired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.