Question: I am trying to find out if a user viewing my site is a mobile user. I have used "HttpContext.Current.Request.Browser.IsMobileDevice " and found it pretty useless as it didn't not pick up on my usage when viewing the site on my phone.

Is there another way to find out if the user is a mobile user that works better?

I have looked at user agent and that just looks messy!

I should point out that this has nothing to do with CSS, I want to log if the user is a mobile user in a database table. 

And yes, I know google analytics can do this already but unfortunately its not my decision!

Thanks

Answer: 
Try to test with this code....

```
    string sUA = Request.UserAgent.Trim().ToLower();

    uaString.InnerText = Request.UserAgent;

    if (sUA.Contains("ipod") || sUA.Contains("iphone"))
        isMobile = true;

    if (sUA.Contains("android"))
        isMobile = true;

    if (sUA.Contains("opera mobi"))
        isMobile = true;

    if (sUA.Contains("windows phone os") && sUA.Contains("iemobile"))
        isMobile = true;

    if (sUA.Contains("fennec"))
        isMobile = true;

```
See my comment on your question for a more thorough answer, but for a simple check to see if the user is a mobile user I would personally suggest

<http://detectmobilebrowsers.com/>