A Common ASP.NET MVC Website For Mobile & Desktop Browsers
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
one posted by Mark here which is based on action filter which will separates DesktopController and Mobile controller. Simple and easy one.
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.
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.
精彩评论