Turning off the WebFormViewEngine when using razor?

It is perfectly OK to remove the web forms view engine if you are not using it. You can do it like:

public class Global : HttpApplication
{
    public void Application_Start()
    {
        // Clears all previously registered view engines.
        ViewEngines.Engines.Clear();

        // Registers our Razor C# specific view engine.
        // This can also be registered using dependency injection through the new IDependencyResolver interface.
        ViewEngines.Engines.Add(new RazorViewEngine());
    }
}

The above method calls go in your global.asax file.

source of code

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)