I have subclassed RazorViewEngine so I can check for Request.Browser.IsMobileDevice and add a special mobile identifier to the view file name for it to grab. However I can’t access the Request object. What should I do?
I have subclassed RazorViewEngine so I can check for Request.Browser.IsMobileDevice and add a special
Share
You can use either the
HttpContext.Current.RequestorContext.Request. Although understand how thatIsMobileDeviceworks. It uses a browser file which contains a list of known user agents. As soon as a new device is built, that list is outdated, but in some cases may still identify the device to be mobile correctly. The recommended way is to use 51Degrees or to connect to the services it encompasses directly.