简体   繁体   中英

ASP.NET MVC3 detecting mobile device

I have a ASP.Net mvc3 web application. I need to create a mobile version for this now.
I'm not able to decide which is this best way to detect a mobile device.

This whitepaper http://www.asp.net/whitepapers/add-mobile-pages-to-your-aspnet-web-forms-mvc-application gives few options. I'm not sure if I should go ahead with 51Degrees.mobi .

Could someone who has implemented device detection, suggest a direction to proceed in. Pros and Cons of taking a particular route...

Try this

function IsMobileDevice() {
    var platform = navigator.platform.toLowerCase();
    return (platform.match(/iphone/) || platform.match(/ipod/) || platform.match(/ipad/));
}

我认为您必须更改设计布局以支持响应式设计,检查引导程序或html5boilerplate,这与服务器端无关。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM