Navigation Class

The navigation API of a window (https://html.spec.whatwg.org/multipage/nav-history-apis.html#navigation-api): the same-origin session history entries of its navigable, the navigations of the navigable (the navigate event, which can cancel or intercept them), and the methods that navigate and traverse.

public sealed class Navigation : EventTarget

Remarks

The states are serialized by the script engine of the window. The promises of the results and of the transitions are settled by the tasks of the event loop. The exceptions that reject them are created in the realm of the window.

See also

Inheritance
EventTarget Navigation

Properties

NameDescription
Activationhttps://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigation-activation
CanGoBackhttps://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigation-cangoback
CanGoForwardhttps://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigation-cangoforward
CurrentEntryhttps://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigation-currententry
OnCurrentEntryChangeGets or sets the event handler of the currententrychange event.
OnNavigateGets or sets the event handler of the navigate event.
OnNavigateErrorGets or sets the event handler of the navigateerror event.
OnNavigateSuccessGets or sets the event handler of the navigatesuccess event.
Transitionhttps://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigation-transition

https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigation-activation

public NavigationActivation? Activation { get; }

https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigation-cangoback

public bool CanGoBack { get; }

CanGoForward

NavigationApi.cs

https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigation-cangoforward

public bool CanGoForward { get; }

CurrentEntry

NavigationApi.cs

https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigation-currententry

public NavigationHistoryEntry? CurrentEntry { get; }

OnCurrentEntryChange

NavigationApi.cs

Gets or sets the event handler of the currententrychange event.

public Action<Event>? OnCurrentEntryChange { get; set; }

Gets or sets the event handler of the navigate event.

public Action<Event>? OnNavigate { get; set; }

OnNavigateError

NavigationApi.cs

Gets or sets the event handler of the navigateerror event.

public Action<Event>? OnNavigateError { get; set; }

OnNavigateSuccess

NavigationApi.cs

Gets or sets the event handler of the navigatesuccess event.

public Action<Event>? OnNavigateSuccess { get; set; }

https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigation-transition

public NavigationTransition? Transition { get; }

Methods

NameDescription
Back(NavigationOptions?)https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigation-back
Entries()https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigation-entries
Forward(NavigationOptions?)https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigation-forward
Navigate(string, NavigationNavigateOptions?)https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigation-navigate
Reload(NavigationReloadOptions?)https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigation-reload
TraverseTo(string, NavigationOptions?)https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigation-traverseto
UpdateCurrentEntry(NavigationUpdateCurrentEntryOptions)https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigation-updatecurrententry

Back(NavigationOptions?)

NavigationApi.cs

https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigation-back

public NavigationResult Back(NavigationOptions? options = null)

https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigation-entries

Forward(NavigationOptions?)

NavigationApi.cs

https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigation-forward

public NavigationResult Forward(NavigationOptions? options = null)

Reload(NavigationReloadOptions?)

NavigationApi.cs

https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigation-reload

public NavigationResult Reload(NavigationReloadOptions? options = null)

TraverseTo(string, NavigationOptions?)

NavigationApi.cs

https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigation-traverseto

public NavigationResult TraverseTo(string key, NavigationOptions? options = null)

UpdateCurrentEntry(NavigationUpdateCurrentEntryOptions)

NavigationApi.cs

https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigation-updatecurrententry

public void UpdateCurrentEntry(NavigationUpdateCurrentEntryOptions options)