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!


Part One

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.

Part Two

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.

Part Three

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.

Part Four

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.

Part Five

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.

About the Author
Avatar photo

Ryan Flachman

Hi! My name is Ryan Flachman. I am a C# developer with experience in modern JS frameworks and a penchant for learning new technologies! I started my coding career in React and fell in love with the component-style architecture but was soon swayed away to the type safety and ecosystem of C# and the Microsoft stack. I worked in .NET MVC for a long time but always wanted to get back to the React style of developing web applications. Then Microsoft introduced Blazor, and I was instantly hooked as it combined all my experiences together.I am a firm believer that any language, framework, or codebase has something to teach you that will make you a better developer. Whether you are working in the newest bleeding edge framework or you are in a 20-year-old Winforms/VB.NET app, there is always a fun problem to solve!