Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

535
Vistas
Using NavigationManager NavigateTo forceload in Blazor server doesn't reload the entire index

Creating dotnet Blazor Server app that uses MS Identity services. When user registers and logins, the app sends them a razor component that adds additional user info not kept in MS Identity - they must complete this to continue. I'm using Identity auth & roles in both navbar and index page redirects. When I run this in the user form (razor component)...

navMgr.NavigateTo("/", forceLoad: true);

It doesn't even leave the razor component which is embedded in Index.razor.

What I would like is that this form completion would completely refresh to "/" for that user (as if they just logged in). Do I have to log the user out to do this?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

This seems to fix the problem in the index.razor page. Used consumer and disabled in my @if().

protected override async Task OnParametersSetAsync()
{
    authstate = await GetAuthenticationStateAsync.GetAuthenticationStateAsync();
    authuser = authstate.User.Identity.Name;
    if (authuser != null)
    {
        user = await userManager.FindByEmailAsync(authuser);
        consumer = await userManager.IsInRoleAsync(user, "Consumer");
        disabled = await userManager.IsInRoleAsync(user, "Disabled");
    }
}
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda