How to use Razor syntax in an ASP.NET web application (not MVC)

How to create a .cshtml page in an ASP.NET web application? The Razor selection option is obvious when using MVC - it appears when adding a view. But I cannot figure out how to do this in a simple ASP.NET web application. Is it possible?

+6
razor
source share
1 answer

Create an HTML file and rename it to CSHTML.

Although Razor pages do not appear in the Add New Item list, they work just fine in regular web projects.

+5
source share

All Articles