/// <summary> /// Check Is Request From Handheld Device /// </summary> /// <returns></returns> public bool IsHandheld() { UserAgentController objAgentController = new UserAgentController(); string GetMode = objAgentController.GetUserAgent(GetPortalID, true); bool status = false; if (GetMode == "3") { string strUserAgent = Request.UserAgent.ToString().ToLower(); 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; } } } else { int Mode = 0; Mode = int.Parse(GetMode); if (Mode == 2) { status = true; } else { status = false; } } return(status); }
public string GetUserAgent() { UserAgentController objController = new UserAgentController(); string getMode = string.Empty; if (Globals.sysHst[ApplicationKeys.UserAgent + "_" + currentportalID] != null) { getMode = Globals.sysHst[ApplicationKeys.UserAgent + "_" + currentportalID].ToString(); } else { getMode = objController.GetUserAgent(currentportalID, true); Globals.sysHst[ApplicationKeys.UserAgent + "_" + currentportalID] = getMode; } return(getMode); }