neowinian
Try adding one additional piece of logic:
&& ctx.Request.UserAgent.IndexOf("mobile", StringComparison.OrdinalIgnoreCase) < 0
This excludes all mobile devices from your DisplayMode for tablet.
DisplayModeProvider.Instance.Modes.Insert(0, new DefaultDisplayMode("Tablet") { ContextCondition = (ctx => (ctx.Request.UserAgent.IndexOf("iPad", StringComparison.OrdinalIgnoreCase) >=0 || ctx.Request.UserAgent.IndexOf("Android", StringComparison.OrdinalIgnoreCase) >= 0) && ctx.Request.UserAgent.IndexOf("mobile", StringComparison.OrdinalIgnoreCase) < 0) });
In addition, you can see:
DisplayModeProvider.Instance.Modes.Insert(1, new DefaultDisplayMode("Mobile") { ContextCondition = (ctx => ctx.GetOverriddenBrowser().IsMobileDevice) });
source share