Mobile device detected as non-mobile device

I included a mobile web form in my asp.net project, I thought that it can / should be seen only for my mobile users, but I understand that it can also be seen from any browser, I do not see the problem there, because I could restrict access using HttpBrowserCapabilities.IsMobileDevice = true and go to the corresponding aspx page, but this leads to the fact that when accessing the web form from my mobile device, it is identified as IsMobileDevice = false and sends me to another page.

How is this possible?

The mobile device runs Pocket PC 2003.

+6
mobile mobile-website
source share
3 answers

Some of them are not recognized because UserAgent is running or using a new browser. For example, Opera Mobile 9.5. To fix this, you need to create a browser file (* .browser) specifically to define it. I had to do this for the new Mozilla-based UserAgent that is being shipped from Google.

+2
source share

IMHO: the value of HttpContext.Current.Request.Headers("User-Agent") is a much safer bet, since it actually indicates the browser that makes the request, and not the type of device per-se.

I learned from experience that if a smartphone makes a request through a third-party browser to your service, more often than not some type of device type test ( HttpCapabilitiesBase.IsMobileDevice and / or HttpContext.Current.Request.Browser.IsMobileDevice ) .

Unfortunately, apart from a large list of allowed user agents (or forbidden user agents, for that matter), you just need to make sure that it does not start from Mozilla, iPhone or Opera before you page ...

This is a heavy arena for the game.
Good luck.

+4
source share

I think you should use a different DDR better than the capabilities of Microsoft Browser. I am using http://wurfl.sourceforge.net> WURFL, it is open source and maybe it is more extended and updated. There are other commercial DDRs such as DeviceAtlas .

There are many some .net libraries, but I use Marg.Wurfl . This allows you to display a web page using the wurfl features.

+1
source share

All Articles