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 - Blazor Tutorial
From the course: Blazor: Getting Started
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,…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Basic Blazor components4m 46s
-
(Locked)
Routing in Blazor4m 59s
-
(Locked)
Dependency injection and services with Blazor8m 42s
-
(Locked)
Blazor component life cycle8m 3s
-
(Locked)
Data binding and events with Blazor3m 47s
-
(Locked)
Binding between Blazor components3m 22s
-
(Locked)
Child content in a Blazor component4m 21s
-
(Locked)
Blazor layouts3m 38s
-
(Locked)
Challenge: Respond to an event in a subcomponent1m 1s
-
(Locked)
Solution: Respond to an event in a subcomponent1m 57s
-
-
-
-
-
-