Blazor Server Overview

In this lesson, we will cover the fundamentals of Blazor Server, which shares many concepts with Blazor WebAssembly but has some fundamental differences in terms of its hosting model.

Introduction to Blazor Server

Blazor Server enables developers to build interactive web applications using C# and .NET, leveraging both server-side and client-side logic. The application's UI runs on the server and establishes a real-time connection with the browser using SignalR—a library for building real-time web functionality. When a user interacts with the UI, such as by clicking a button or filling out a form, the interactions are sent to the server, where the UI is updated, and the changes are then synchronized to the connected clients' browsers.

This model allows for the creation of rich, interactive web applications while maintaining the bulk of the application's logic on the server, which can be advantageous in scenarios where network latency or client resources are a concern. It offers a programming model similar to SPAs but without requiring as much client-side processing power.

Just like Blazor WebAssembly, Blazor Server simplifies the development process for .NET developers who want to build web applications using familiar languages and tools, allowing them to create modern web applications without having to rely solely on JavaScript. Also, while different Blazor hosting models use different dependencies and different start-up codes, the Razor components use identical syntax.

Blazor Server’s project structure

The following playground contains a standard project template for a Blazor Server application:

Get hands-on with 1200+ tech skills courses.