Source

MobileViewEngines / App_Start / MobileViewEnginesBootstrapper.cs

Full commit
shanselman 4831099 














using System.Linq;
using System.Web.Mvc;
using Microsoft.Web.Mvc;
 
[assembly: WebActivator.PreApplicationStartMethod(typeof(MvcApplication1.App_Start.MobileViewEngines), "Start")]
namespace MvcApplication1.App_Start {
    public static class MobileViewEngines{
        public static void Start() 
        {
			ViewEngines.Engines.Remove(ViewEngines.Engines.OfType<RazorViewEngine>().First());
			ViewEngines.Engines.Add(new MobileCapableRazorViewEngine());
			ViewEngines.Engines.Remove(ViewEngines.Engines.OfType<WebFormViewEngine>().First());
			ViewEngines.Engines.Add(new MobileCapableWebFormViewEngine());
        }
    }
}