-2

I am a newbie .NET developer. I have a website wherein I need to detect whether access to the website is from a TABLET. There is a mobile version of the site but my client wants it such that when the site is accessed through a tablet, a modified version of the main site should appear instead of the mobile site. Thus I need to detect access specifically from tablets. Can anyone please help me with this?

Mani
  • 379
  • 1
  • 4
  • 22
  • Could you please remove the duplicate tag? Is that going to mess with the answers that I might get if it isn't there? My question deals with detecting access from tablets and only tablets and not rest of the mobile device such as mobile phones. Also I cannot use the third party tool suggested. – Mani Jul 02 '14 at 10:32
  • 1
    The exact same techniques used for other mobile devices are also used for tablets. More than one technique was suggested in the answers to the linked duplicate question. – John Saunders Jul 02 '14 at 13:26

2 Answers2

1

We have used 51Degrees mobi, which does a redirect if it detects a mobile device. There's a free version available (less configurable), but please see the overview for a comparison.

  • I cannot use any third party tool, is there any other option such as using the display size or something? – Mani Jul 02 '14 at 09:59
0

you can use javascript to detect mobile device and then redirect to other link.

As like following to detect mobile devices

if (!RegExp(" Mobile/").test(navigator.userAgent)) 
{
   // redirect to your old site.
}

For user agent string see following link that may help you. How to detect tablet, mobile, desktop, tv using javascript

Community
  • 1
  • 1
Abid Hussain
  • 102
  • 1
  • 10
  • Thanks Abid, but the problem here is that I need to isolate tablets, the mobile redirection stuff is already implemented such that it redirects to the mobile page – Mani Jul 02 '14 at 10:23