I would like to study the source of the Razor view engine. Since MS provides the source for MVC, I assumed that Razor's is available too... but have been unable to locate it. Any suggestions?
The Razor View Engine is more advanced and is now the default view engine of ASP.NET Core MVC. This article compares these two view engines in brief and then discusses how you can work with the Razor View Engine in ASP.NET Core MVC. To work with the code examples provided in this article, you should have Visual Studio 2019 installed in your system.
It is a server side markup language. Razor has no ties to ASP.NET MVC because Razor is a general-purpose templating engine. You can use it anywhere to generate output like HTML. It's just that ASP.NET MVC has implemented a view engine that allows us to use Razor inside of an MVC application to produce HTML.
The Razor View Engine is now the default view engine for ASP.NET Core MVC applications. While the ASPX View Engine is available as part of the System.Web.Mvc.WebFormViewEngine namespace, the Razor View Engine is available in the Microsoft.AspNetCore.Mvc.Razor namespace. How does a view engine work?
The namespace for Razor Engine is System.Web.Razor. View file extension is .cshtml or .vbhtml (partial and layout view) based on language. Razor syntax is easy to learn and much cleaner than Web Form syntax. Razor Engine does not support design mode in VS means you can not see your view page look and feel.
The source for MVC 3 Beta version of Razor is available here: http://aspnet.codeplex.com/releases/view/54306. However, this release is quite old and there have been a number of changes to Razor.
The final source for Razor will be made available soon after the release of MVC3 RTM
I know this is an old question, but Microsoft just released the source code for Razor, WebMatrix.Data, System.Json, and a number of other ASP.NET stack technologies.
See the source code here . Apache 2.0 license.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With