WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

ASP Browser Capabilities


ASP Browser Capabilities Component

The ASP Browser Capabilities segment makes a BrowserType object that decides the sort, abilities and variant number of a guest's browser.

When a program interfaces with a server, a User Agent header is likewise sent to the server. This header contains data about the browser.

The BrowserType object contrasts the data in the header and data in a document on the server called "Browscap.ini".

If there is a match between the program type and form number in the header and the data in the "Browscap.ini" document, the BrowserType object can be utilized to list the properties of the coordinating program. In the event that there is no counterpart for the program type and form number in the Browscap.ini document, it will set each property to "UNKNOWN".

Syntax

<%
Set MyBrow=Server.CreateObject("MSWC.BrowserType")
%>

ASP Browser Capabilities Example

The model beneath makes a BrowserType object in an ASP record, and shows a portion of the abilities of your browser:

Example

<!DOCTYPE html>
<html>
<body>
<%
Set MyBrow=Server.CreateObject("MSWC.BrowserType")
%>

<table border="0" 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>
</table>

</body>
</html>

Output:

Client OS WinNT
Web Browser IE
Browser version 5.0
Frame support? True
Table support? True
Sound support? True
Cookies support? True
VBScript support? True
JavaScript support? True