5 votes

51Degrees - Mobile Device Detection and Redirection

Project Description

This project, called "Foundation", is just one of 51Degrees components for mobile web development. It’s provided as a .NET open source class library that detects mobile devices and browsers, enhancing the information available to .NET programmers. Using 51Degrees Device Data, accurate screen sizes, input methods, plus manufacturer and model information are all available. Mobile handsets can optionally be redirected to content designed for mobile devices. Smart phones, tablets and feature phones are all supported.

Mobile Optimized Web Sites

Foundation detects the presence of a mobile device, and enables the web request to be directed to web pages designed for mobile. 51Degrees other products help ASP.NET developers rapidly create fast mobile web pages supporting tablet devices, high end handsets, and basic feature phones. Learn More & Free Trial.

Accurate Device Data

We now maintain and supply our own device data so that the Foundation has accurate data for nearly all devices, browsers and operating systems that can be updated weekly without any intervention. Our device data can be used to find screen sizes, input methods and even the best size of a button for that particular device. Learn more about our device data.

How does it work?

Http requests are intercepted by an additional HttpModule before the page handler starts to process the page. The first task of the module is to detect the device making the request and enhance the default properties provided by Microsoft by 51Degrees Device Data. For example; the Request.Browser.ScreenPixelsWidth property will return the precise value for the mobile device. Finally the module determines if the request should be sent to a mobile home page and performs the redirection. The web.config file can be used to control how detection and redirection operate for your specific web site. For example; some sites may wish to redirect only the very first request to a mobile home page enabling the user to navigate to the traditional home page.

To find out more try downloading our detection example web site or reading the operational summary.

Major changes in Version 3.2

  • Removed data file from initial download. Download Lite version under resources.
  • Embedded data has been removed from the assembly and now must be provided from the App_Data folder.
  • .NET 3.5 is not supported in this release in order to use memory mapped files and simplify overriding default browser capabilities.
  • In stream mode entity data properties that can allocate large arrays only initialise these arrays when needed.
  • Caches used with stream operation are now fixed memory size and serviced via the thread pool.
  • Automatic update processes uses temporary files rather than main memory to verify integrity of updated files prior to using them.
  • Temporary files are now created in the App_Data/51Degrees folder of the web application rather than a UNC path or the master data file folder.
  • Values associated with Profiles are now retrieved using a more efficient algorithm.
  • DataSet.Properties collection now has a string accesser to make retrieving properties by name simpler.
  • Web sites using memory mode use a byte array to improve start up time.
  • Version 3.2 data file formats are supported in parallel with version 3.1 data files.
  • 51Degrees unit tests are now part of the open source distribution.



Archived files


Source code

 Download package

NuGet install instructions for Umbraco versions below 9

Install-Package 51Degrees.mobi-web

Package owner

James Rosewell

James Rosewell

James has 71 karma points

Package Compatibility

This package is compatible with the following versions as reported by community members who have downloaded this package:
Untested or doesn't work on Umbraco Cloud
Version 8.18.x (untested)

You must login before you can report on package compatibility.

Previously reported to work on versions:

Package Information