O'Reilly logo

ASP.NET MVC 4 Mobile App Development by Andy Meadows

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Display modes

Display modes are new to ASP.NET MVC 4. They allow us to target specific devices based on some matching criteria contained in an HttpContext, typically a user-agent string. Upon a match, the display mode identifies the suffix appended to any view specific to the device. It is actually this technology underlying the .Mobile suffix we just learned about.

Display modes are represented by an implementation of the IDisplayMode interface defined in System.Web.WebPages. At application startup, implementations of IDisplayMode can be registered with the current DisplayModeProvider.

We will be creating and registering an instance of IDisplayMode for the Asus Nexus 7. Our new display mode will use a suffix of nexus7 for any Asus Nexus 7 specific ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required