NavigationManager.NavigateTo() vs NavigateToLogout()?

David Thielen 2,281 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

Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,396 questions
0 comments No comments
{count} votes

Accepted answer
  1. AgaveJoe 26,136 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