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

181
Views
Scroll click not working with NavigationManager.NavigateTo, and I can't use href because I need forceLoad functionality

I have a Blazor Server web app; .NET 5.

I am running into frustrations related to navigating between pages in my web app:

  • When I use NavigationManager.NavigateTo(uri, true), I am unable to open links using my scroll click (which would open the link in a new browser tab if I were to use href="uri" instead). It opens a new tab, but loads the same page I was already on.
  • When I use href="uri" instead, the scroll-click works. However, it introduces a new problem: with a 'normal' left-click, the new page loads but retains the scroll position of the previous page in a mobile browser (I have tested with mobile Safari, as well as the mobile emulator in Chrome).

I need to be able to scroll-click into a new tab, as well as have a new page load without retaining the previous page's scroll position. Any tips?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Assuming that you are using the onclick event: The onclick event does not listen for the scroll wheel click. To fix this just use the onmousedown event instead:

<button class="btn btn-dark" @onmousedown="OnClick">Test</button>

@code {

    private void OnClick()
    {
        NavigationManager.NavigateTo("/counter", true);
    }

}
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!