Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

533
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!