MobileFilter Class
Detects if controller is being accessed via a mobile device.
Remarks
Detects if controller is being accessed via a mobile device. If so, it will change the layout name by prepending "mobile-" to the name, and by defining a PropertyBag value "_IsMobileDevice". This assumes that, for the most part, the layout contain a lot of extreneous elements (fly-out menus, images) as well as the CSS include. By changing the layout (and including a different CSS) the same controller and view template used normal output, can be reformated to be presentable on a mobile device. This will detect any mobile device that has a *.browser file defined either for the system (in C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\Browsers) or locally (in ~\App_Browsers). Since these tend to be out of date, it also triggers on "Windows CE" or "Smartphone" in the user-agent.
TODO: An explicit test for iPhones should probably be added.
Example
[Layout("default"), Rescue("generalerror")] [Filter(ExecuteEnum.BeforeAction,typeof(MobileFilter))] public class ShowController : SmartDispatcherController
If viewed from a mobile device, the layout will be changed to "mobile-default".
