Professional Documents
Culture Documents
The Browser Capabilities Component
The Browser Capabilities Component
The Browser Capabilities Component
CAPABILITIES
COMPONENT
DONE BY:
HARINI.D
1732J08
SYNOPSIS:
◦ INTRODUCTION
◦ BROWSER CAPABILITIES COMPONENT
◦ SYNTAX
◦ REASON BEHIND BROWSER CAPABILITIES COMPONENT
◦ THE BROWSCAP.INI FILE
◦ SYNTAX FOR BROWSCAP.INI FILE
◦ FUNCTIONALITY OF BROWSER CAPABILITIES COMPONENT (BROWSCAP.INI
FILE)
◦ SYNTAX FOR THE PROPERTIES IN BROWSCAP.INI FILE
◦ EXAMPLE
◦ OUTPUT
◦ CONCLUSION
INTRODUCTION:
◦ Browser capability means whether a particular browser support different features like java
script, Frames, Cookies, etc.
◦ Different types of features are being supported by different browsers or by the different
versions of the same browser.
◦ When we make a request for a page to the server through the browser then Asp.net
automatically determines the browser capabilities and render the appropriate markup for that
particular browser. However, sometimes some control features are not being supported by
older browsers.
◦ When a browser connects to a server, a User Agent header is also sent to the server. This header
contains information about the browser.
◦ The BrowserType object compares the information in the header with information in a file on the server
called "Browscap.ini".
◦ If there is a match between the browser type and version number in the header and the information in
the "Browscap.ini" file, the BrowserType object can be used to list the properties of the matching
browser.
◦ If there is no match for the browser type and version number in the Browscap.ini file, it will set every
property to "UNKNOWN".
SYNTAX:
<%
Set
MyBrow=Server.CreateObject("MSWC.BrowserType")
%>
REASON BEHIND BROWSER CAPABILITIES
COMPONENT:
◦ The recent plethora of new Web technologies has created a dilemma for Web authors.
◦ Which technologies do you use to design your Web pages? VBScript (Visual Basic, Scripting
Edition), ActiveX controls, Java applets, frames, and cascading style sheets are each
supported in some browsers but not in others.
◦ So do you write applications that only the most technically capable browsers can use?
◦ You can check a browser's capabilities and send HTML that you know the browser can
handle.
THE BROWSCAP.INI FILE:
◦The "Browscap.ini" file is used to declare properties and to set default values for browsers.
◦The browscap.ini file's layout is like any other .ini file, and it must be in the same directory
as the component itself (the browscap.dll file).
◦Within the browscap.ini file, each browser definition has its own section and each section
has any number of properties that you can set.
◦You can also insert comments in the browscap.ini file, which are indicated by a semicolon
(;).
[IE 4.0]
◦ You can use an asterisk as a wildcard in the HTTP user agent header. If the Browser Capabilities component cannot find the exact
HTTP header, it tries to find the header by substituting any wildcards in the header.
◦ If more than one header matches the user agent header sent by the browser, the first matching header is used. For example,
[Mozilla/2.0 *]
matches
and
[;comments]
[HTTPUserAgentHeader]
[parent=browserDefinition]
[property1=value1]
[propertyN=valueN]
[Default Browser Capability Settings]
[defaultProperty1=defaultValue1]
[defaultPropertyN=defaultValueN]
EXAMPLE:
OUTPUT:
CONCLUSION: