Blazor Uri
How it works Get it from injection before to use it on .razor pages: Or like this on .cs if you prefer “code-behind” experience: Sample NavigationManager cheatsheet Helpers code: Sources: https://docs.microsoft.com/en-us/dotnet/api/system.uri?view=net-5.0 https://stackoverflow.com/questions/50102726/get-current-url-in-a-blazor-component