Introduction
Blazor creates interactive web applications using .NET that allow you to share app logic on both the server and client side, without the complexity of managing client-side JavaScript libraries.
Suppose that a pizza delivery firm hired you to modernize its customer-facing website. You already built pages for them that display pizzas and enable customers to customize the toppings for their pizzas. Now, you want to add ordering pages and improve the app's navigation. You also want to ensure a consistent layout across the app to ensure that customers can find what they're looking for easily.
In this module, you learn about how to route customers through the app by using the @page
directive, Blazor routing, and the NavLink
component. With navigation working, you focus on how to reduce duplicate code by adding layouts to the app.
Learning objectives
At the end of this module, you're able to:
- Improve your Blazor app's navigation by using the router component and NavLinks.
- Enhance functionality with route parameters.
- Reduce duplicate code by using layouts in your Blazor app.