what i am trying to achieve is simple; Among all the view which i have in my web application, i have only two razor views that i have created a mobile version for them. so i
I use this method to detect mobile and desktop
if (eDurar.MobileDetect.DeviceType.Any(m => Request.UserAgent.Contains(m))) { Layout = "~/Views/Shared/_mobileLayout.cshtml"; @Html.Partial("mobileIndex"); } else { Layout = "~/Views/Shared/_Layout.cshtml"; @Html.Partial("desktopIndex"); }