I have been looking for a comprehensive article for quite a while and couldn’t find exactly what I was looking for.
What are they?
How do you use them?
Why would you use one over another?
What is the performance of every one?
And is “Blazor” the same thing as “Razor Pages”? That’s what I thought.
Well, I think the Microsoft docs do a pretty good job explaining what they are. Not sure if there’s a comparison page though.
MVC and Razor Pages are very similar under the hood. Razor pages are a newer implementation of MVC that that tries to hide some of the boiler plate code. Some different syntax but essentially very similar. They are server hosted.
Blazor is very different from both of these and it comes in different flavors. One is an app that runs entirely on the client (WebAssembly, like a PWA) without the need for a hosting server. The other is a hybrid that uses SignalR to interact with a server hosted backend.
MVC is legacy for server-side rendering.
Razor Pages is the new way for server-side rendering.
Blazor is the only way of doing client-side rendering aka single page application with C# only, you don’t need JavaScript.