ASP Browser Component Instance Tutorial
ASP components for Browser capabilities
The browser features an ASP component to create a BrowserType object that determines the type, functionality and version number of each browser to access your site.
When the browser is connected to a server, an HTTP user Agent header is also sent to the server. This header contains information about browsers (such as browser type and version number). The BrowserType object then compares the information in the information with the message header in a file on the server called "Browscap.ini".
If there is a match between the browser type and the version number sent by the title and information of the "Browsercap.ini" file, you can use the BrowserType object to list the properties that match the browser. If there is no matching browser type and version number of the Browscap.ini file, each set of property "Unknown".
Grammar
<%
Set mybrow=server.createobject ("MSWC. BrowserType ")
%>
The following example creates a BrowserType object in an ASP file and displays a table listing some features in the current browser:
<%
Set mybrow=server.createobject ("MSWC. BrowserType ")
%>
<table border= "1" width= "100%" > <tr> <th>client os</th> <th><%=MyBrow.platform%>
</th> </tr><tr> <td >web browser</td> <td ><%=MyBrow.browser%></td> </tr><tr> <td>browser version</td> <td><%=MyBrow.version%></td> </tr ><tr> <td>frame support?</td> <td><%=MyBrow.frames%></td> </tr><tr > <td>table support?</td> <td><%=MyBrow.tables%></td> </tr><tr> <td >sound support?</td> <td><%=MyBrow.backgroundsounds%></td> </tr><tr> <td >cookies support?</td> <td><%=MyBrow.cookies%></td> </tr><tr> <td> VBScript support?</td> <td><%=MyBrow.vbscript%></td> </tr><tr> <td> JavaScript support?</td> <td><%=MyBrow.javascript%></td> </tr>%