Blazor Server in .NET 6
This five-part educational series on Blazor Server in .NET 6 includes step-by-step instructions for creating a new Blazor Server application. By the end, you will be able to create a SPA application using Blazor, quickly access and store data from an API, display that on the screen in reusable components, and get your components to react to events dynamically to allow for a great user experience. Tune in to get up to speed on all the benefits of Blazor!
In Part 1, we learn how to create a new Blazor server application with both the CLI and Visual Studio methods. This gives us a brief primer for creating our own Character Builder application. We also walk through creating a Blazor page, navigating to our new page, and creating a component to display data on a Character Page.
In Part 2, we learned how to utilize Blazor Protected Browser Storage. We also cover how to build a base component and implement ProtectedStorage on the Characters Page.
In part 3, we install a free component library called Radzen.Blazer, update the CharacterInfo component to easily display a Create Character modal, and add the RadzenDialog as a way to standardize our dialog with an easy-to-use component.
In Part 4, we cover adding events in our Blazor components. This includes a demonstration on how to add a service that contains the events that components can listen to with methods to notify when to invoke our events. Next, the service is added to the BaseComponent and to our list of current characters in storage.
The 5th and final part covers how to use data binding and dropdowns with lists and enums. This includes a short introduction to setting up an HttpService, making a get call to the API, and viewing the results as a string. For further clarity, a demonstration on how to add an HttpService that uses the built-in .NET HttpClient class to make calls to the D&D 5e API is included.
For more helpful recourses on .NET, we encourage you to check out our other blogs on the subject, all written by Keyhole's team of consultants.