Relative Content

Tag Archive for blazorblazor-server-side

NavigationManager.NavigateTo() in Blazor web app?

I cannot get NavigationManager.NavigateTo(“/servers”) to work in my project. The /servers endpoint is valid with a @page “/servers”. I’ve tried everything and cannot get it to work. I get an Exception of type ‘Microsoft.AspNetCore.Components.NavigationException’ was thrown.

How can I automatically sign-in a user after they set their password in a Blazor interactive SSR page?

We have a Blazor (8) Interactive Server site. It is using cookies auth and was built using the standard blazor templates. I have an interactive Set Password page, which successfully creates the user (from a button click in a form); that user can then be used to log in from the static login page. We would like to be able to log the user in automatically as soon as the user is created, which is a problem in an interactive page because we don’t have access to the HttpContext that the SignInManager uses, and the form doesn’t POST in the usual way because it’s using a SignalR connection to interactively create the user. How can I get around this? I can see the following options: