0

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...

Andrii Kalytiiuk
  • 1,491
  • 13
  • 25
Jovel JV
  • 11
  • 1
  • 4
  • [This](http://stackoverflow.com/q/3514784/1184435) [SO](http://stackoverflow.com) question provides your answer regardless of `ASP.net MVC 3`. – Devraj Gadhavi Dec 30 '13 at 07:47
  • Thanks. I'm looking for server side device detection. – Jovel JV Dec 30 '13 at 07:50
  • Then have a look at [this](http://stackoverflow.com/q/5233090/1184435) question. – Devraj Gadhavi Dec 30 '13 at 07:52
  • The in built `Request.Browser.IsMobileDevice` does not include latest devices. 51Degrees.mobi is one way of doing, wanted to know if theres any drawbacks going this way or if there is a better way – Jovel JV Dec 30 '13 at 09:16

2 Answers2

0

Try this

function IsMobileDevice() {
    var platform = navigator.platform.toLowerCase();
    return (platform.match(/iphone/) || platform.match(/ipod/) || platform.match(/ipad/));
}
Amit
  • 14,671
  • 8
  • 41
  • 63
0

I think you have to change your design Layout to support responsive design, check bootstrap or html5boilerplate, it's nothing related to server side.

Besher
  • 517
  • 2
  • 7
  • 28