Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

538
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda