From the course: Blazor: Getting Started

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Routing in Blazor

Routing in Blazor - Blazor Tutorial

From the course: Blazor: Getting Started

Start my 1-month free trial

Routing in Blazor

- [Instructor] We saw when we started our new component in the last video that we were able to navigate to it, with the simple string in the page directive. But how did that work? The first place to look is in the app.razor file in beam.client. This file is the starting point for a blazer application. The root component here is the blazer router. We see here that our router is declared and it's set up with an assembly that contains our program type from the program.CS file. This is the base component for the application and enables navigation to other components. The options for the router are found and not found. If there is a page compiled into the application with a matching route, found is rendered. Otherwise the content in not found is rendered. If found, we pass the route data like URL parameters and set the layout for the route view, like in our user page. In the case of not found, we're still using the main layout,…

Contents