开发者

A Common ASP.NET MVC Website For Mobile & Desktop Browsers

开发者 https://www.devze.com 2023-03-14 11:45 出处:网络
We are planning for a ASP.NET MVC e-commerce website common for desktop browsers and mobile (mostly smart phones). Main thing is i am not interested in different web address. All url should be same fo

We are planning for a ASP.NET MVC e-commerce website common for desktop browsers and mobile (mostly smart phones). Main thing is i am not interested in different web address. All url should be same for all devices.

After some search found out some techniques to achieve开发者_C百科 my requirement

  1. one posted by Mark here which is based on action filter which will separates DesktopController and Mobile controller. Simple and easy one.

  2. Other by scott hanselman post which is based on mobile browser detection file. Instead of using separate controller will have separate view folder hierarchy for different devices.

  3. Mobile Web app toolkit. I come across this and i didn't go through it fully. but it also seems to similar like hanselman's post.

My Question is which is better one to use or is there any thing better than above three????

Thanks,

Pradeep.


Here is a new Asp.NET MVC3 View Engine for desktop and mobile that gives MVC3 features close to what ASP.NET MVC 4 will have: http://www.hanselman.com/blog/NuGetPackageOfTheWeek10NewMobileViewEnginesForASPNETMVC3SpeccompatibleWithASPNETMVC4.aspx


Actually, all three are basically the same - the only difference is that the first one uses a filter attribute to apply mobile views to specific action, and the other modifies the view engine to look for mobile views on any action.

The view engine approach will be slightly easier to use because after the initial setup you only need to create a mobile view in the right folder to get it working.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号