想在mvc4中创建一个移动友好的应用程序 [英] want to create a mobile friendly application in mvc4
本文介绍了想在mvc4中创建一个移动友好的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果我正在创建一个移动友好的应用程序,如何设置routeconfig.cs文件。如果我将在手机中打开网址,它将重定向到移动视图,如果我将在桌面打开该应用程序,它将显示桌面view
解决方案
使用MVC创建新的Web应用程序时,您将拥有一个响应式设计 - 基于引导程序 - 将采用屏幕尺寸...
但是如果你想创建两个站点 - 对于桌面和移动设备,你可以阅读这些文章...
http://www.asp.net/mvc/overview/older-versions/aspnet-mvc-4-mobile-features [ ^ ]
http://www.hanselman.com/blog/MakingASwitchab leDesktopAndMobileSiteWithASPNETMVC4AndJQueryMobile.aspx [ ^ ]
how to set the routeconfig.cs file if I am creating a mobile friendly application.ie..if I will open url in phone it will redirect to mobile view and if I will open the application in desktop it will show the desktop view
解决方案
When creating a new web application with MVC you will have a responsive design - based on bootstrap - that will adopt to the screen size...
However if you want to create two sites - for desktop and for mobile you may read these articles...
http://www.asp.net/mvc/overview/older-versions/aspnet-mvc-4-mobile-features[^]
http://www.hanselman.com/blog/MakingASwitchableDesktopAndMobileSiteWithASPNETMVC4AndJQueryMobile.aspx[^]
这篇关于想在mvc4中创建一个移动友好的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文