Last post Apr 04, 2019 06:46 PM by PatriceSc
Apr 04, 2019 06:15 PM|Sukhisukh|LINK
I am trying to add device detection to our websites. The desktop part of code is written in ASP.Net Core many years back and the mobile device related code is in MVC 4. How do I handle redirection from one to the other based on devices, hoping to keep it
under same domain name. Just the content to be served should come from different code bases based on the device used to access the website.
Thanks for all your help and guidance.
Apr 04, 2019 06:46 PM|PatriceSc|LINK
My understanding is that you have an https://domain.com/desktop and
https://domain.com/mobile app and want to redirect from one to the other depending on the device ?
Your best bet is likely to use
https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries to test the device screen characteristics. For example you could add a cookie to keep the user choice and if no choice is done yet and the "user" is on the wrong side, use
a media query to show a link that offers to go to the other version.