Switchable desktop and mobile view in MVC projects

Scott made an awesome article about implementing a switchable desktop and mobile view in your MVC projects.

Additional hints:

The solution above provided doesn’t work for android phones. Add this code in your Global.asax to get it done.

DisplayModeProvider.Instance.Modes.Insert(0, new DefaultDisplayMode("Mobile")
{
ContextCondition = ctx => ctx.GetOverriddenUserAgent().Contains("iPhone") || ctx.GetOverriddenUserAgent().Contains("Windows Phone OS") || ctx.GetOverriddenUserAgent().Contains("Android")
});

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind markiert *


× 7 = dreißig fünf