-
November 9th, 2010, 03:24 AM
#1
ASP.NET Mobile Detection And Redirection Made Easy
Hello,
For the users who are using http://mdbf.codeplex.com/ [This project is no longer supported and is removed on October 29, 2010]
Do not worry, you can 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.
You can very easily define the redirection by simply updating your web.config as per below sample. The below sample allows you to redirect user to mobile device specific pages based on rules created.
<redirect firstRequestOnly="false"
mobileHomePageUrl="~/Mobile/Default.aspx"
timeout="20"
devicesFile="~/App_Data/Devices.dat"
mobilePagesRegex="/(Apple|RIM|Nokia|Mobile)/">
<locations>
<location url="~/Apple/Default.aspx">
<add property="MobileDeviceManufacturer" matchExpression="Apple"/>
</location>
<location url="~/RIM/Default.aspx">
<add property="MobileDeviceManufacturer" matchExpression="RIM"/>
</location>
<location url="~/Nokia/Default.aspx">
<add property="MobileDeviceManufacturer" matchExpression="Nokia"/>
</location>
</locations>
</redirect>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|