2

I'm developing a website and want to provide a mobile and desktop friendly experience to the user.

Coming from base html5/css/js development, I know enough css tricks, mobile first techniques, liquid layouts and media queries to get along fine but to optimize the solution even more and taking into consideration that I'm currently starting to work with .net/mvc(incl. razor) I'm looking for new options.

I've read about device detection techniques (currently favoring http://51degrees.codeplex.com/ ) and now I'm trying to figure out the options I have to optimize my website for all users.

I don't want mobile users to load the large versions of images and unnecessary scripts/stylesheets/background images etc. and I don't want to overwrite all mobile stylesheets as in a "mobile first" approach.

As I have just started working / learning how to work with the MVC pattern I'm asking you: Is it possible with the MVC pattern / development to build one combined website (not a desktop and a mobile version) and include javascript, image urls, stylesheets etc. based on the user client / device using "if else" and an option to let the user switch to the full version on demand.

tereško
  • 58,060
  • 25
  • 98
  • 150
All Bits Equal
  • 731
  • 2
  • 10
  • 26

1 Answers1

1

You could build seperate Mobile Views for your Actions and use them if the site is called from a mobile devide or use the Default View is called from a desktop.

  • Thank you for your input. I know that having a mobile view coexisting with the default view is a common practice. Maybe it's because I'm not familiar with the details of mvc (still clicking through http://www.asp.net/mvc/tutorials to get a better idea of the concept and structure). My problem with this approach is that I'm planning to streamline the parallel development of both "mobile" and "desktop" version (as well as touch-based small mobile + tablet mobile) and would like to prefer an approach where I use conditional rendering to make the necessary changes between different versions. – All Bits Equal Dec 02 '11 at 15:36