/ Published in: ASP

Detect if browser is a mobile in asp
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<% Function Is_Mobile() Is_Mobile= instr("|up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone|windows ce|pda|mobile|mini|palm|ipad|","|" & Request.ServerVariables("HTTP_USER_AGENT") & "|" ) > 0 End Function %> //USAGE <%If Is_Mobile() then%> <h1>You are using a mobile device</h1> <%Else%> <h1>You are not using a mobile device</h1> <%End If%>
Comments
