Skip to content

Instantly share code, notes, and snippets.

@alantsai
Created December 8, 2015 10:16
Show Gist options
  • Save alantsai/7cdf8e78eddd51ecbf74 to your computer and use it in GitHub Desktop.
Save alantsai/7cdf8e78eddd51ecbf74 to your computer and use it in GitHub Desktop.
Asp .net Mvc - only include Razor View Engigne. From http://stackoverflow.com/questions/5912980/turning-off-the-webformviewengine-when-using-razor #asp.net-mvc
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());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment