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

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

TFTPD32 or TFTPD64 reports Bind error 10013 An attempt was made to access a socket in a way forbidden by its access permissions.

Windows Server 2019 desktop icons such as My Computer, Windows cannot access the specified device, path, or file.