jeudi 9 avril 2015

Detect desktop, phone, or tablet in VIsual Basic web app

I'm currently working on a Visual Basic web app. The app should send the user to a mobile version of the site if they are accessing it from a phone. However, if it is a tablet (or desktop), it should still go to the full site.


Here is what I have so far but it doesn't account for differing pixel densities and whatnot.



If Request.Browser.ScreenPixelsWidth < 600 And Request.Browser.ScreenPixelsHeight < 1024 And Request.Browser.IsMobileDevice Then
Response.Redirect("http://localhost:9999/mobile")
End If


Thank you in advanced





Aucun commentaire:

Enregistrer un commentaire