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:

if (screen size & lt; 840px) HTTP Contex Set Override Broser (Browseroverride.mobile)

It looks like HttpBrowserCapablilties Objects in a ScreenPixelsWidth and ScreenPixelsHeight code> I think you can base it on it.



Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -