Mobile Browser User-Agent Detector

While working on a project recently I needed to be able to determine if the user was coming to the ASP.Net site was using a mobile browser. In my particular case, the IsMobileBrowser property didn’t work so I created this code to do it for me, based on the information i gleamed from Enjoy.

string[] arr = new string[]
"Windows CE",
"PlayStation Portable",
"Symbian OS",
"Opera Mini",

foreach (string s in arr) {
if (Context.Request.UserAgent.ToLower().Contains(s.ToLower()))

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.