Adding the Store Page

Learn how to create a store page and demonstrate how the state is lost in Blazor WebAssembly.

To add a store, we need to add a Store component to our web app. We do this as follows:

  1. Open the Shared\NavMenu.razor page.
  2. 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.

  1. Right-click the Pages folder and select the “Add, Razor Component” option from the menu.

  2. Name the new component Store ...