I need to do something like this
DisplayModeProvider.Instance.Modes.Insert(0, new DefaultDisplayMode("iPhone")
{
ContextCondition = (context => context.GetOverriddenUserAgent().IndexOf
("iPhone", StringComparison.OrdinalIgnoreCase) >= 0)
});
But seems it wount work in MVC 3 project.
How can I enable DefaultDisplayMode supporting?
Display modes are an ASP.NET MVC 4 feature. If you want to get this behaviour then you either need to upgrade to ASP.NET MVC 4 or write a custom view engine for ASP.NET MVC 3.