O'Reilly logo

Professional ASP.NET MVC 4 by Scott Hanselman, K. Scott Allen, Brad Wilson, Phil Haack, Jon Galloway

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

Mobile Support

Using mobile devices for viewing websites is becoming increasingly common. Some estimates show mobile devices account for 20 percent of web traffic, and it's on the rise. It's important to think about your site's appearance and usability on mobile devices.

There are a variety of approaches for enhancing the mobile experience of your web application. In some cases, you just want to make some minor style changes on smaller form factors. In others you may want to completely change the visual appearance or content of some views. And in the most extreme case (before moving from mobile web application to native mobile application), you may want to create a web application that is specifically targeted at mobile users. MVC 4 provides a range of options to target each of these scenarios:

  • Adaptive rendering: The default Internet and Intranet application templates use CSS media queries to gracefully scale down to smaller mobile form factors.
  • Display Modes: MVC 4 uses a convention-based approach to allow selecting different views based on the browser making the request. Unlike adaptive rendering, this allows you to change the markup that's sent to mobile browsers.
  • Mobile project template: This new project template helps you to create web applications that are intended for mobile-only use.
Mobile Emulators
The screenshots in this section use Windows Phone Emulator, available from http://msdn.microsoft.com/en-us/library/ff402563.aspx.
I encourage you to try some other ...

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