WebView.NavigationFailed 事件

定义

注意

在Windows 8.1后,NavigationFailed 可能会更改或不可用。 请改用 NavigationCompleted

WebView 无法完成导航尝试时发生。

public:
 virtual event WebViewNavigationFailedEventHandler ^ NavigationFailed;
/// [add: Windows.Foundation.Metadata.Deprecated("NavigationFailed may be altered or unavailable for releases after Windows 8.1. Instead, use NavigationCompleted.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, Windows.Foundation.UniversalApiContract)]
/// [remove: Windows.Foundation.Metadata.Deprecated("NavigationFailed may be altered or unavailable for releases after Windows 8.1. Instead, use NavigationCompleted.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, Windows.Foundation.UniversalApiContract)]
// Register
event_token NavigationFailed(WebViewNavigationFailedEventHandler const& handler) const;

// Revoke with event_token
void NavigationFailed(event_token const* cookie) const;

// Revoke with event_revoker
WebView::NavigationFailed_revoker NavigationFailed(auto_revoke_t, WebViewNavigationFailedEventHandler const& handler) const;
/// [add: Windows.Foundation.Metadata.Deprecated("NavigationFailed may be altered or unavailable for releases after Windows 8.1. Instead, use NavigationCompleted.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
/// [remove: Windows.Foundation.Metadata.Deprecated("NavigationFailed may be altered or unavailable for releases after Windows 8.1. Instead, use NavigationCompleted.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
// Register
event_token NavigationFailed(WebViewNavigationFailedEventHandler const& handler) const;

// Revoke with event_token
void NavigationFailed(event_token const* cookie) const;

// Revoke with event_revoker
WebView::NavigationFailed_revoker NavigationFailed(auto_revoke_t, WebViewNavigationFailedEventHandler const& handler) const;
[add: Windows.Foundation.Metadata.Deprecated("NavigationFailed may be altered or unavailable for releases after Windows 8.1. Instead, use NavigationCompleted.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, typeof(Windows.Foundation.UniversalApiContract))]
[remove: Windows.Foundation.Metadata.Deprecated("NavigationFailed may be altered or unavailable for releases after Windows 8.1. Instead, use NavigationCompleted.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, typeof(Windows.Foundation.UniversalApiContract))]
public event WebViewNavigationFailedEventHandler NavigationFailed;
[add: Windows.Foundation.Metadata.Deprecated("NavigationFailed may be altered or unavailable for releases after Windows 8.1. Instead, use NavigationCompleted.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
[remove: Windows.Foundation.Metadata.Deprecated("NavigationFailed may be altered or unavailable for releases after Windows 8.1. Instead, use NavigationCompleted.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
public event WebViewNavigationFailedEventHandler NavigationFailed;
function onNavigationFailed(eventArgs) { /* Your code */ }
webView.addEventListener("navigationfailed", onNavigationFailed);
webView.removeEventListener("navigationfailed", onNavigationFailed);
- or -
webView.onnavigationfailed = onNavigationFailed;
Public Custom Event NavigationFailed As WebViewNavigationFailedEventHandler 
<WebView NavigationFailed="eventhandler" />

事件类型

属性

适用于