Examples of using Mobile Device Browser File for redirect

Aug 3, 2010 at 1:47 PM
Edited Aug 3, 2010 at 1:48 PM

Does anyone have working examples of using the Mobile Device Browser File to create a website redirect to a mobile website? I've tried to take what's here and make this work, but I just haven't had much luck. I'm working in VB.

Thanks in advance,
Nathan Webster 

Dec 14, 2010 at 5:54 PM


Instead of using MDBF please use http://51degrees.codeplex.com/. It is an ASP.NET open source module  which detects mobile devices and provides auto redirection to mobile optimized pages when request is coming from mobile device. It makes use of WURFL mobile device database. For redirection there is no need to modify existing ASP.NET web application pages.

Below is sample web.config settings to show how easy it is to implement mobile detection and rediection without modifying any of your existing asp.net web pages.

In this example MobileDeviceManufacturer is used as the property. This properties are exposed through the HttpRequest classes Browser property. Both WURFL capabilities and ASP.NET Browser properties can be used with the property attribute. If none of the <locations> match and the requesting device is a mobile device then the mobileHomePageUrl will be used.

<redirect firstRequestOnly="true"
<!--Send iphone to their own home page.-->
<location url="~/Apple/Default.aspx">
<add property="MobileDeviceManufacturer" matchExpression="Apple"/>
<!--Send blackberry to their own home page.-->
<location url="~/RIM/Default.aspx">
<add property="MobileDeviceManufacturer" matchExpression="RIM"/>
<!--Send nokia to their own home page.-->
<location url="~/Nokia/Default.aspx">
<add property="MobileDeviceManufacturer" matchExpression="Nokia"/>