prevent F5 refresh - prvent event bubbling

Posted 334 days ago by Rexadecimal
0

hi,

on a simple Blazor server app - no authentication used. I need to intercept the F5 keypress and do my own bespoke page refresh. What is easiest way to detect F5, call my own refresh function and prevent the F5 from doing default refresh?

Can I add a specific function for each page in its own associated pagename.razor.js file?

My issue is every time a user does F5 then application returns to index page and leaves the current page. Is this a routing issue or should I implement my own F5 function? This seems a common problem for SPA's ?

Any and all advice appreciated.

  • 0

    This sounds like a routing issue. I'm guessing you have some code somewhere that is redirecting users to the home page. I'd search the solution for all your NavigationManager/redirect code to see if you can find something.  By default, users should be able to refresh a page without being sent to the home page.

    Posted 333 days ago by selliott Edited 333 days ago
Someone is typing...

Post a Reply

You must be logged in to add a new post.
Number of online users: 3
An error has occurred. This application may no longer respond until reloaded. Reload 🗙