How can i detect if the request is coming from a mobile browser in my asp.net MVC 3

前端 未结 10 1995
旧时难觅i
旧时难觅i 2020-12-14 08:11

what i am trying to achieve is simple; Among all the view which i have in my web application, i have only two razor views that i have created a mobile version for them. so i

10条回答
  •  星月不相逢
    2020-12-14 09:07

    Using 51Degrees' Open source .Net Api, which you can get here, https://github.com/51Degrees/dotNET-Device-Detection, you can detect a huge variety of mobile devices.

    You can do something similar to this in the 51Degrees.config file to enable redirect.

    
      
        
        
          
        
        
          
        
      
    
    

    For more information on this you can look here https://51degrees.com/Developers/Documentation/APIs/NET-V32/Web-Apps/Configuration/Redirect

    Disclosure: I work for 51Degrees

提交回复
热议问题