Blazor lets you build interactive UIs with C# instead of JavaScript—components run WebAssembly in the browser (Blazor WASM) or on the server via SignalR (Blazor Server).
Two hosting models
- Blazor Server — UI events round-trip to server; small download, needs persistent connection
- Blazor WebAssembly — .NET runs in browser; offline-capable, larger initial payload
Component sketch
@page "/counter"
<h1>Count: @count</h1>
<button @onclick="Increment">+</button>
@code {
int count;
void Increment() => count++;
}
When to consider Blazor
.NET-only teams wanting shared types between API and UI; internal tools; scenarios where JavaScript churn is costly. Many public SPAs still use React/Vue with ASP.NET Core APIs.
Important interview questions and answers
- Q: Blazor vs React?
A: Blazor uses C# components; React uses JS/TS with huge ecosystem—pick based on team skills and UI needs. - Q: Blazor Server latency?
A: Every interaction hits server—fine on LAN, sensitive on high-latency mobile networks.
Self-check
- Name the two main Blazor hosting models.
- When might you still pair ASP.NET API with React?