Using view engines

When ASP.NET Core 2.0 uses server-side code for rendering HTML, it uses a View Engine. By default, when building standard views with their associated .cshtml files, you use the Razor View Engine with the Razor syntax, for example.

By convention, this engine is able to work with views, which are located within the Views folder. Since it is built-in and the default engine, it is bound automatically to the HTTP Request Pipeline without you doing anything for it to work.

If you need to use Razor for rendering files that are located outside of the Views folder and don't come directly from the HTTP Request Pipeline, such as email templates for example, you cannot use the default Razor View Engine. Instead, you need to define ...

Get Learning ASP.NET Core 2.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.