Understanding client-side routing
The routing and layout of Blazor bear similarities to the concepts of Shell and navigation in the XAML realm. In Chapter 5, Navigation Using .NET MAUI Shell and NavigationPage, we introduced navigation and Shell while discussing the routing strategy of Shell. Shell offers a URI-based navigation experience that relies on routes to navigate to designated pages. The routing of Blazor closely resembles this approach.
Blazor routing allows for seamless transitions between Razor pages. Rendering Razor pages in BlazorWebView
is akin to web apps operating in a browser.
In traditional web applications, loading an HTML page in a browser fetches the page from the web server. Selecting a different route subsequently retrieves a new page from the server. However, the process varies slightly for single-page applications (SPAs).
Blazor WebAssembly applications fall under the category of SPAs. When launching an app, it is loaded into the browser, and...