A Better ASP.NET MVC Mobile Device Capabilities ViewEngine
In March of 2009 I spoke at Mix 09, Microsoft's Web Conference and presented a number of ASP.NET MVC features. I extended the NerdDinner Sample with a naive implementation of what I called a MobileCapableWebFormViewEngine. Here's the basic implementation. Don't use this, it's broken. public class MobileCapableWebFormViewEngine : WebFormViewEngine { public override ViewEngineResult FindView(ControllerContext controllerContext, string viewName, string masterName, bool useCache) { ViewEngineResult result = null; var request = controllerContext.HttpContext.Request; // Avoid unnecessary checks if this device isn't suspected to be a mobile device if (request.Browser.IsMobileDevice) { result = base.FindView(controllerContext, "Mobile
Read More...
Read the complete post at http://www.hanselman.com/blog/ABetterASPNETMVCMobileDeviceCapabilitiesViewEngine.aspx