From the course: Blazor WebAssembly: Foundational Skills

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

NavigationManager

NavigationManager

- [Instructor] The Navigation Manager class can be used for managing page navigation in an application. Examples of this involve getting the current URL, displaying pages for a listing, or redirecting a user to a page when an event has happened, for example, adding an item to the shopping cart. The navigation manager instance can be injected into a razor component by calling the inject directive, declaring the NavigationManager type, and naming it navigationManager. Inside the navigationManager class, there are a number of methods that can be used. The BaseUri gets the beginning part of the URL. This consists of the protocol and the host name. The Uri gets the full URL of the page that the user is currently on. And the GetUriWithQueryParameter displays the current URL where a query string parameter can be added or updated to it. This can be used to display a list of pages within a product listing. At the moment, there are…

Contents