c# - Set mobile mode based on screen resolution size in MVC? -
Is there a way to classify requests in the form of a mobile or desktop based on screen size instead of user agent?
For example, the iPad Retina will not have any problem viewing my site as a desktop, but I want the iPad 1 to be recognized as a mobile device. If you try to determine the screen size from the user agent for Android devices, then it will be out of control. There is a way to do something like this in MVC:
It looks like if (screen size & lt; 840px) HTTP Contex Set Override Broser (Browseroverride.mobile)
HttpBrowserCapablilties Objects in a
ScreenPixelsWidth and
ScreenPixelsHeight code> I think you can base it on it.
Comments
Post a Comment