NavigationManager.NavigateTo() vs NavigateToLogout()?

David Thielen 3,216 Reputation points
2023-06-10T02:56:59.0866667+00:00

There's the specific calls of NavigateToLogin() and NavigateToLogout(). So clearly they do something differne from NavigateTo(). So what is the difference?

You have to pass a url to each, so what is different from:

NavigationManager.NavigateTo("/logout");

and:

NavigationManager.NavigateToLogout("/logout");

And while we're at it, what is different for:

NavigationManager.NavigateToCore("/logout");

thanks - dave

Developer technologies | .NET | Blazor
0 comments No comments
{count} votes

Answer accepted by question author
  1. AgaveJoe 30,396 Reputation points
    2023-06-10T10:24:35.4466667+00:00

    The NavigateToLogin extension method calls the NavigateTo() overload that adds the URL to browser history.

    NavigationManagerExtensions.NavigateToLogin Method

    The NavigateToLogout() is similar. See the source code.

    https://github.com/dotnet/aspnetcore/blob/main/src/Components/WebAssembly/WebAssembly.Authentication/src/NavigationManagerExtensions.cs


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.