Answered by:
Difference between Razor & Blazor

Question
-
User1295747327 posted
I am learning .Net core mvc, On the documentation i can see Razor Pages & Blazor sections.
Are they the same or different? any difference?
which one should i use?
Wednesday, December 25, 2019 12:18 PM
Answers
-
User1289604957 posted
Hi,
Razor is a solution for server-based architecture that can handle API logic and server-side templating, but it cannot offer client-side logic outside of javascript.
Blazor is the next step (and hopefully successor) that will allow the same server-side functionality as Razor but will integrate client-side logic using
C#
instead of javascript.Best regards,
Maher
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, December 25, 2019 2:51 PM -
User711641945 posted
Hi EngSH,
As Maher said,Razor Pages is a web framework, just like the MVC framework. When you use Razor Pages, you create pages that employ Razor syntax and C#, just like Blazor, which explains why they seem so similar, at first glance. However, Razor Pages are created on the server only, and the Html Content is output (rendered) and pushed to users' browser. Their architecture is different, and you need to learn a range of classes in order to program in either of them.
Reference:
https://docs.microsoft.com/en-us/aspnet/core/razor-pages/?view=aspnetcore-3.1&tabs=visual-studio
https://docs.microsoft.com/en-us/aspnet/core/blazor/?view=aspnetcore-3.1
https://espressocoder.com/2019/02/21/whats-the-difference-between-razor-and-blazor/
Best Regards,
Rena
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Thursday, December 26, 2019 2:53 AM
All replies
-
User1289604957 posted
Hi,
Razor is a solution for server-based architecture that can handle API logic and server-side templating, but it cannot offer client-side logic outside of javascript.
Blazor is the next step (and hopefully successor) that will allow the same server-side functionality as Razor but will integrate client-side logic using
C#
instead of javascript.Best regards,
Maher
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, December 25, 2019 2:51 PM -
User711641945 posted
Hi EngSH,
As Maher said,Razor Pages is a web framework, just like the MVC framework. When you use Razor Pages, you create pages that employ Razor syntax and C#, just like Blazor, which explains why they seem so similar, at first glance. However, Razor Pages are created on the server only, and the Html Content is output (rendered) and pushed to users' browser. Their architecture is different, and you need to learn a range of classes in order to program in either of them.
Reference:
https://docs.microsoft.com/en-us/aspnet/core/razor-pages/?view=aspnetcore-3.1&tabs=visual-studio
https://docs.microsoft.com/en-us/aspnet/core/blazor/?view=aspnetcore-3.1
https://espressocoder.com/2019/02/21/whats-the-difference-between-razor-and-blazor/
Best Regards,
Rena
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Thursday, December 26, 2019 2:53 AM