Table of contents
TOC
折叠目录
展开目录

WebBrowserControl.NavigateError 事件 (访问)WebBrowserControl.NavigateError Event (Access)

office 365 dev account|上次更新日期: 2018/3/13
|
2 参与人员

当导航期间出现错误时发生该事件。Occurs when an error occurs during navigation.

语法Syntax

表达式如何(* * pDisp,* * URL,* * TargetFrameName,* *状态代码,* 取消)expression. **NavigateError( ** pDisp, ** URL, ** TargetFrameName, ** StatusCode, ** Cancel* )

表达式_一个表示WebBrowserControl对象的变量。_expression A variable that represents a WebBrowserControl object.

参数Parameters

名称Name必需/可选Required/Optional数据类型Data Type说明Description
pDisppDisp必需RequiredObjectObject指向表示的窗口或框架出现导航错误的 web 浏览器对象的IDispatch接口的指针。A pointer to an IDispatch interface for the WebBrowser object that represents the window or frame in which the navigation error occurred.
URLURL必需RequiredVariantVariant包含导航失败的 URL。Contains the URL for which navigation failed.
TargetFrameNameTargetFrameName必需RequiredVariantVariant包含要在其中显示资源,则为NULL ,如果没有命名的框架面向资源的框架的名称。Contains the name of the frame in which to display the resource, or NULL if no named frame was targeted for the resource.
状态代码StatusCode必需RequiredVariantVariant包含错误状态代码(如果有)。Contains an error status code, if available.
CancelCancel必需RequiredBooleanBoolean指定是否取消到错误页面或任何其他自动搜索的导航。Specifies whether to cancel the navigation to an error page or to any further autosearch.

返回值Return Value

nothingnothing

注解Remarks

web 浏览器控件将显示在导航窗格中由于错误一个错误页之前,将激发此事件。您可以停止错误页的显示_取消_参数设置为True。但是,如果联系在原始的导航窗格中的服务器提供其自己的替代页面导航,取消_设置为True时,它已经不起作用,并继续执行到服务器的备用页的导航。例如,假定到 http://www.www.wingtiptoys.com/BigSale.htm 的导航导致此事件,以激发,因为该页面不存在。但是,服务器设置将导航重定向到 http://www.www.wingtiptoys.com/home.htm。在这种情况下,将_取消_设置为**True**,当它不起作用,和导航进入http://www.www.wingtiptoys.com/home.htm。This event fires before the WebBrowser control displays an error page due to an error in navigation. You can stop the display of the error page by setting the _Cancel parameter to True. However, if the server contacted in the original navigation supplies its own substitute page navigation, when you set Cancel to True, it has no effect, and the navigation to the server's alternate page proceeds. For example, assume that a navigation to http://www.www.wingtiptoys.com/BigSale.htm causes this event to fire because the page does not exist. However, the server is set to redirect the navigation to http://www.www.wingtiptoys.com/home.htm. In this case, when you set Cancel to True, it has no effect, and navigation proceeds to http://www.www.wingtiptoys.com/home.htm.

另请参阅See also

概念Concepts

WebBrowserControl 对象WebBrowserControl Object

© 2018 Microsoft