Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

NavigationManager.Uri does not update at all unless page is refreshed. How to get real current URI in Blazor Server?

$
0
0

I have a link in a side menu like this (Blazor Server):

<NotAuthorized><li class="nav-item px-3"><NavLink class="nav-link" href="@($"LoginIDP?redirectUri=    {NavigationManager.Uri}")">       Login</NavLink></li></NotAuthorized>

The idea is simple: I want to keep the redirectUri={NavigationManager.Uri} part updated with the current Uri the user is on at all times, so no matter on which page/component the user clicks the login link, the correct redirectUri is always passed to the login page.

But in reality, as the user clicks various other <NavLink> on the page, the URI in the browser's address bar does change, so does the page content, but NavigationManager.Uri remains the same unless I refresh the page.

Is this by design? How do I obtain the real current Uri without changing every link to some event call that forces updates?


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>