Server-side mobile device check
Problem: When we want to display information conditionally according to end devices used, we may use CSS Media Queries. However, they do not prevent additional overhead from rendering server-side controls. Solution: Use server side checks, either to the growing unsupported Request.Browser.IsMobileDevice property, or by check the User Agent for specific sets of strings. public static bool IsMobileDevice(HttpRequest request) { try { //IsMobileDevice property if (request.Browser.IsMobileDevice) { return true; } //user agent check var useragent = request.UserAgent; string[] stringArray = { "android", "ipad", "iphone", "ipod" }; if(useragent != null) { if (stringArray.Any(s => useragent.ToLower().Contains(s))) ...