//adds a new CaseInsensitiveViewEngine to the routes provided public static void Register(ViewEngineCollection engines) { //clear the existing WebForm View Engines IViewEngine[] webforms = engines.Where(engine => engine is WebFormViewEngine).ToArray(); foreach (IViewEngine engine in webforms) ViewEngines.Engines.Remove(engine); //add the new case-insensitive engine ViewEngines.Engines.Add(new CaseInsensitiveViewEngine()); }
//adds a new CaseInsensitiveViewEngine to the routes provided public static void Register(ViewEngineCollection engines) { //clear the existing WebForm View Engines IViewEngine[] webforms = engines.Where(engine => engine is WebFormViewEngine).ToArray(); foreach (IViewEngine engine in webforms) { ViewEngines.Engines.Remove(engine); } //add the new case-insensitive engine ViewEngines.Engines.Add(new CaseInsensitiveViewEngine()); }