IsMobileDevice returns false for iPhone using .NET 3.5

When using .NET 3.5 or earlier you find that you can detect a mobile browser using the following property. However when using new devices such as iPhones the value always returns false.

HttpContext.Current.Request.Browser.IsMobileDevice

This is because this version of the .NET framework is not aware of new devices such as iPhones

For this property to be correctly detected you need to download the browser definition files from CodePlex and place them in the app_browsers directory

The IsMobileDevice should now return the correct value.






Comments

Popular posts from this blog

SOLVED: Exchange Online Management PowerShell Connect-ExchangeOnline bug "A window handle must be configured. See https://aka.ms/msal-net-wam#parent-window-handles"

Windows Server 2016, 2019, 2022, Windows 10 and Windows 11: Date and time "Some settings are managed by your organization".

get-windowsfeature : The given key was not present in the dictionary