Adding the Store Page
Learn how to create a store page and demonstrate how the state is lost in Blazor WebAssembly.
We'll cover the following...
To add a store, we need to add a Store
component to our web app. We do this as follows:
- Open the
Shared\NavMenu.razor
page. - Add the following markup before the closing
ul
tag:
Press + to interact
<div class="nav-item px-3"><NavLink class="nav-link" href="store"><span class="oi oi-home" aria-hidden="true"></span>Store</NavLink></div>
The preceding markup adds a menu option for the “Store” page.
-
Right-click the
Pages
folder and select the “Add, Razor Component” option from the menu. -
Name the new component
Store
...