In this series, you will learn how to build a simple website with Blazor WebAssembly. To make Blazor WebAssembly works, you will need a server. For the sake of simplification, we will simulate the result from the server in this tutorial series. The website is going to have the following features:
In this tutorial, you will learn:
You can download the example code used in this topic on GitHub.
First thing first, you need to have the following software and knowledge to developing Blazor WebAssembly websites.
Software:
Do not install .NET 6 Runtime and ASP.NET and Web development from outside Visual Studio Installer.
Run Visual Studio Installer from your machine, Modify your Visual Studio 2022 Current.
Select .NET 6 Runtime and ASP.NET and Web development.
Knowledge:
Start your Visual Studio, select Create a new project.
When you create a new Blazor WebAssembly project, there will be a default template with the boilerplate code, you will need to remove those boilerplate codes in order to continue development. The following image indicates the file that you need to remove:
After that, open NavMenu.razor
to remove the link on the menu as well.
.... <div class="nav-item px-3"> <NavLink class="nav-link" href="counter"> <span class="oi oi-plus" aria-hidden="true"></span> Counter </NavLink> </div> <div class="nav-item px-3"> <NavLink class="nav-link" href="fetchdata"> <span class="oi oi-list-rich" aria-hidden="true"></span> Fetch data </NavLink> </div> ....