Try it (this is a simple function to check if the browser has a handheld device)
string strUserAgent = Request.UserAgent.ToString().ToLower(); bool status = false; if (strUserAgent != null) { if (Request.Browser.IsMobileDevice == true || strUserAgent.Contains("iphone") || strUserAgent.Contains("blackberry") || strUserAgent.Contains("mobile") || strUserAgent.Contains("windows ce") || strUserAgent.Contains("opera mini") || strUserAgent.Contains("palm")) { status = true; } }
Paras source share