I have this code in ASP.net, but like to use something similar on older Classic ASP pages. I can't rename the pages from .asp to .aspx, too many out there and spidered in the search engines. I am looking to display specific messages to mobile users and other messages to non-mobile users. Any input is appreciated. Thanks
<script language="VB" runat="server"> Sub Page_Load(sender as Object, e as EventArgs) if Request.Browser.Browser = "AppleMAC-Safari" then Response.Write("mobile") else Response.Write("not mobile")
In Classic Asp there is a Browser Capabilities Com object supplied by Microsoft, using that with Browser.ini [browsers.garykeith.com] supplied by Gary and updated very very often. With these two you should be able to identify most of the common mobiles and web browsers out there currently.
Example of the Browser Capabilties Com Object in Classic Asp. <% ' create an instance of the Browser Capabilities component Set browserdetect = Server.CreateObject("MSWC.BrowserType")