33 Using Blazor Server, part 1

 

This chapter covers

  • Creating Razor Components to add client-side interactivity to ASP.NET Core applications
  • Understanding how JavaScript events are used to respond to user interaction
  • Managing event propagation in a Razor Component
  • Understanding how to define Razor Components

Blazor adds client-side interactivity to web applications. There are two varieties of Blazor, and in this chapter, I focus on Blazor Server. I explain the problem it solves and how it works. I show you how to configure an ASP.NET Core application to use Blazor Server and describe the basic features available when using Razor Components, which are the building blocks for Blazor Server projects. I describe more advanced Blazor Server features in chapters 34–36, and in chapter 37, I describe Blazor WebAssembly, which is the other variety of Blazor. Table 33.1 puts Blazor Server in context.

33.1 Preparing for this chapter

33.2 Understanding Blazor Server

33.2.1 Understanding the Blazor Server advantages

33.2.2 Understanding the Blazor Server disadvantages

33.2.3 Choosing between Blazor Server and Angular/React/Vue.js

33.3 Getting started with Blazor

33.3.1 Configuring ASP.NET Core for Blazor Server

33.3.2 Creating a Razor Component

33.4 Understanding the basic Razor Component features

33.4.1 Understanding Blazor events and data bindings

33.4.2 Working with data bindings

33.5 Using class files to define components

33.5.1 Using a code-behind class

33.5.2 Defining a Razor Component class

Summary