Changing the viewing engine after creating a project

I created a project in asp.net mvc4 and installed its View Engine in ASPX. Now I want to change the View Engine to Razor. How to do it? I do not want to create a new project. I want to use an existing project to change the viewing mechanism. Can we change the view mechanism from properties or in some way?

+4
source share
1 answer

It should be as simple as

ViewEngines.Engines.Clear(); ViewEngines.Engines.Add(new RazorViewEngine()); 

Add it to Application_Start in global.asax.

+9
source

Source: https://habr.com/ru/post/1480924/


All Articles