Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Razor syntax in ASP.NET Web Application (not MVC)

Tags:

asp.net

razor

How does one create a .cshtml page in an ASP.NET web application? The option to choose Razor is obvious when using MVC - it appears when adding a view. But I can't seem to figure out how to accomplish this in a plain ASP.NET Web Application. Is it even possible?

like image 334
James Jones Avatar asked Feb 27 '11 21:02

James Jones


1 Answers

Create an HTML file and rename it to CSHTML.

Although Razor pages don't appear in the Add New Item list, they work fine in normal web projects.

like image 131
SLaks Avatar answered Nov 11 '22 12:11

SLaks