locked
ASP.NET Mobile Detection RRS feed

  • Question

  • User-880412325 posted

    Hello

    I am looking for an ASP.NET component/module which will help to detect mobile requesting website. I want to detect the request source, if it is coming from mobile i want to redirect user to mobile optimized web pages rather than standard website pages.

    Can you please let me know whether any component/modules are available which can be used directly

    Thanks in advance

    Wednesday, October 20, 2010 3:19 AM

Answers

  • User214117797 posted

    I am looking for an ASP.NET component/module which will help to detect mobile requesting website. I want to detect the request source, if it is coming from mobile i want to redirect user to mobile optimized web pages rather than standard website pages.
     

     

    The standard ASP.NET framework will identify the users browser as whether mobile or not.

    Simply interrogate the IsMobileDevice property

    Request.Browser.IsMobileDevice

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, October 20, 2010 10:51 PM
  • User1943143334 posted

    Hi,

    You need a MDBF file to detect whether the requesting source is from Mobile device or not.

     Check the following link,

    http://mdbf.codeplex.com

    NOTE: The MDBF file will not be available from OCT 29, 2010. Download before that for sure.

    The above link contains a mobile.browser file, which contains almost all Mobile devices, but they are removing those in another 10 days.

    So if you want latest files, Check the following link.

    http://roopeshreddy.wordpress.com/2010/09/23/latest-browser-configuration-files/

     

    Hope it helps u...

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, October 22, 2010 9:48 AM
  • User1135281112 posted

    Hello

    Instead of MDBF use http://51degrees.codeplex.com. Below is the sample web.config how easily you can configure multiple redirection based on MobileDeviceManufacturer property. You can use other WURFL properties to make your own custom rule for redirection. 

    <fiftyOne>
        <redirect firstRequestOnly="true"
                  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>
    
        </fiftyOne>
    


     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 9, 2010 3:04 AM

All replies

  • User214117797 posted

    I am looking for an ASP.NET component/module which will help to detect mobile requesting website. I want to detect the request source, if it is coming from mobile i want to redirect user to mobile optimized web pages rather than standard website pages.
     

     

    The standard ASP.NET framework will identify the users browser as whether mobile or not.

    Simply interrogate the IsMobileDevice property

    Request.Browser.IsMobileDevice

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, October 20, 2010 10:51 PM
  • User1943143334 posted

    Hi,

    You need a MDBF file to detect whether the requesting source is from Mobile device or not.

     Check the following link,

    http://mdbf.codeplex.com

    NOTE: The MDBF file will not be available from OCT 29, 2010. Download before that for sure.

    The above link contains a mobile.browser file, which contains almost all Mobile devices, but they are removing those in another 10 days.

    So if you want latest files, Check the following link.

    http://roopeshreddy.wordpress.com/2010/09/23/latest-browser-configuration-files/

     

    Hope it helps u...

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, October 22, 2010 9:48 AM
  • User1135281112 posted

    Hello

    Instead of MDBF use http://51degrees.codeplex.com. Below is the sample web.config how easily you can configure multiple redirection based on MobileDeviceManufacturer property. You can use other WURFL properties to make your own custom rule for redirection. 

    <fiftyOne>
        <redirect firstRequestOnly="true"
                  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>
    
        </fiftyOne>
    


     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 9, 2010 3:04 AM
  • User-880412325 posted

    Thanks, works good.

    Monday, November 15, 2010 9:01 AM