home-hero

Frequently Asked
Questions

What is the difference between Blazor vs. Razor?

Razor is a popular template markup syntax for .NET. Blazor (Browser + Razor) is a .NET based web framework which can run on the client using WebAssembly or running on the server via SignalR.

To give an example, Razor is the syntax you use when creating web apps with ASP.NET, which you’ve probably seen before:

<h1>
    Hello @Model.FirstName
</h1> 

Razor takes care of rendering your HTML based on the data in your model, while also supporting various conditionals and loops.

On the other hand, Blazor is a technology similar to ASP.NET Core & ASP.NET MVC in that:

  • It powers web applications
  • It uses Razor as its template syntax for the creation of UI.

A common point of misconception is that Blazor uses Razor. This further exacerbated by two other similar terms – Blazor UI components and Razor components. Those are widely used interchangeably but the correct terminology is Razor Component. A component is the combination of markup (written in HTML) and logic (in C#) in a single Razor file (with the .cshtml extension).

For more detailed explanation, we would suggest checking out our blog post dedicated to the topic of differences between Blazor vs. Razor.