What are the differences between .cshtml and .razor?

Alvaro 0 Reputation points
2023-04-24T05:10:02.5666667+00:00

I think I have use them interchangeably at this point and I just want to clarify what is the correct approach (if any) and the recommended usage. I have identified .cshtml on WebApp templates while .razor con BlazorApp projects

Thanks for the help :)

.NET
.NET
Microsoft Technologies based on the .NET software framework.
4,103 questions
Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,672 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,411 questions
{count} votes

1 answer

Sort by: Most helpful
  1. SARAVANA KUMAR GOPALAKRISHNAN 0 Reputation points
    2023-10-27T09:17:04.2233333+00:00

    cshtml Razor Views (or Razor page), mashes the data and markup together, and returns the entire thing to the browser (re-rendering the entire page). Blazor, on the other hand, allows you to create an entire web page using a series of smaller components written in Razor syntax.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.