This code will help you to understand how to perform programmatic routing without a URL change.
You can perform routing without changing the URL with the help of NavigationManager. You need to inject NavigationManager to use this service. You can use this service to perform routing programmatically.
Service Injection
@inject NavigationManager Navigate <button @onclick="NavigateTo">Navigate</button> @code { private void NavigateTo(){ Navigate.NavigateTo("url");//specify required url here } }
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
You can perform routing without changing the URL with the help of NavigationManager. You need to inject NavigationManager to use this service. You can use this service to perform routing programmatically.
Service Injection
need an explanation for this answer? contact us directly to get an explanation for this answer