mobiForge
Ad

Lightweight Device-Detection in ASP

Device detection is the first step in performing content adaptation. Here we cover lightweight device detection using classic ASP (VBScript). This is based on the PHP version found here. It is a simple script which will detect most mobile browsers. However, if you need more information about the properties of the device such as screen width and height, image format support etc. so that you can tailor your content to specific devices, then you need something more than this. In this case you should consider using a full device properties database such as DeviceAtlas.

This script attempts to match the requesting UA string against about 90 well-known mobile browser UA string snippets, and a couple of special cases. It also checks some of the other HTTP headers for hints that the client is mobile.

If you simply need to decide if the client is a mobile or desktop browser, then this script is for you! If you need to know more about a requesting device, try DeviceAtlas. Improvements and suggestions are very welcome.

 

 

 

To use this script, simply include it in any page for which you wish to determine whether the client is mobile or desktop.

Note that this script uses Option Explicit. If you want to use this script with code that does not use Option Explicit, you should comment out the first two lines to avoid compilation errors.

Other Products

Market leading device intelligence for the web, app and MNO ecosystems
DeviceAtlas - Device Intelligence

Real-time identification of fraudulent and misrepresented traffic
DeviceAssure - Device Verification

A free tool for developers, designers and marketers to test website performance
mobiReady - Evaluate your websites’ mobile readiness

© 2024 DeviceAtlas Limited. All rights reserved.

This is a website of DeviceAtlas Limited, a private company limited by shares, incorporated and registered in the Republic of Ireland with registered number 398040 and registered office at 6th Floor, 2 Grand Canal Square, Dublin 2, Ireland