I use MVC 4 with this custom displaymodeprovider. Even if I set it as “false” it still on iPhone returns mobile version, though I want to return regular version of the website. Please help
DisplayModeProvider.Instance.Modes.Insert(0, new
DefaultDisplayMode("Mobile")
{
ContextCondition = (context => false)
});
I set the break point inside this this code and it calls, though it still return mobile version.
Eventually I’ve figured out the problem
MVC 4 already has his own redirection for “Mobile” prefix. so to use custom logic we need to remove that DisplayModeProvider for “Mobile” prefix, like this:
This answer will be very useful for people who want that their website will be available in both versions for iPad or iPhone or Android and we can for example store in coockie user selection which version of the website we should display in his device.