Hello,
I have asp mvc application. I tried to detect user agent with:
@if (Request.UserAgent.Contains("Mobi") == true || Request.UserAgent.Contains("Android") == true)
and with javascript
alert(navigator.userAgent);
It's working ok but today I tried to check my app on Samsung Galaxy Tab s2 (SM-T715) and my app doesn't detect any Mobi or Android in user agent.
My IIS log file detects Mozilla/5.0+(X11;+Linux+x86_64)+AppleWebKit/537.36+ KHTML,+like+Gecko)+Chrome/76.0.3809.132+Safari/537.36
but i went on my tablet to http://whatsmyuseragent.org and it shows
Mozilla/5.0 (Linux; Android 7.0;SM-T715)AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36
Why I'm getting different user agent, and how I can fix it. It should detect this is mobile/android device but it doesn't. I think it's related to IIS settings.