InternetUnicodeHTMLCSSScalable Vector Graphics (SVG)Extensible Markup Language (xml)ASP.NetDocument Object Model (DOM)JavaScript Ad Rotator Component Draft for Information Only
Content
ASP Server Components
ASP Server ComponentsSome of the ASP server components are the common features found in dynamic web pages. These base ASP server components are provided to enrich the pre-made functions of ASP technology for making dynamic and interactive web pages. However, some IIS pre-made components are not installed for all version of IIS. Ad Rotator, Browser Capabilities, Content Linker, Content Rotator, Counters, Logging Utility, My Info, Page Counter, Status, and tools are not installed with IIS 6.0. However, if you upgrade your Web server from a previous version of IIS, the pre-made components are not removed. Some IIS pre-made components, ASP content rotator and nextlink, are deprecated in IIS7. And most IIS pre-made components are either not installed with IIS7 or their usage is not supported. Browser Capabilities ComponentThe Browser Capabilities Component can be used to create a BrowserType object that acts as a data collection in an ASP page for providing a description of the capabilities of the client's web browser to the ASP scripts. The function of the BrowserType object is to automate the checking of the capabilities of the user browser against the database each time when an user sents an HTTP request to open or reload the web page. A text file called browser.ini file is used to store the information about the capabilities of browsers. Both new properties or new browser definitions available in the market can be added to database by updating the Browscap.ini file. The mechanism of the function is made use of the HTTP User Agent header sent by the browser when connecting to the web server. The HTTP User Agent header is an ASCII string of the browser identifier and version number. The HTTP User Agent header is then used by the BrowserType object to compare with the entries in the Browscap.ini file. If the BrowserType object finds a matched entry in the Browscap.ini file, the properties of the matched browser in the Browsercap.ini is assumed to be the properties of the connected user Browser and is assigned to the properties of the BrowserType object accordingly. If the BrowserType object cannot find a matched entry for the HTTP User Agent header in the Browscap.ini file, the BrowserType object will try to search for the closest matched entry by using the * and ? wildcards. If the BrowserType object cannot find a closest matched entry for the HTTP User Agent header in the Browscap.ini file, the BrowserType object will use the default browser settings as the properties of the connected user browser if the default browser capability settings is defined in the Browscap.ini. When the BrowserType object cannot find a matched entry or a closest matched entry and default browser settings have not been specified in the Browscap.ini file, the BrowserType object sets every property to the string "UNKNOWN." File NameThe file name of the Browser Capabilities component is Browscap.dll. SyntaxSet BrowserTypeName = Server.CreateObject("MSWC.BrowserType") ParametersBrowserTypeName The parameter "BrowserTypeName" is the name assigned to the instance of the BrowserType object created by the call using the Server.CreateObject. RemarkThe Browser Capabilities Component does not work with Internet Information Server 7 (IIS7). Browscap.ini FileThe Browscap.ini File is used to store the default properties of browser setting and the database entries of the properties of browsers for the Browser Capabilities Component. The default value of the properties of browser is used to set the properties of browser when there is no matched entry found in the Browscap.ini file. Any property definitions can be declared for any number of browser in the Browscap.ini file. Each browser definition entry should contain the HTTP User Agent header, and the associated property definitions, that is the name of properties and the corresponding value setting of the properties. For the format of the HTTP User Agent header, the HTTP specification can refer to http://www.w3.org/Protocols/Specs.html for details. The Browscap.ini File should be stored in the same directory as the Browscap.dll fille. Each parameter or setting is stroed in one single line. Comments is allowed anywhere in the Browscap.ini by starting a new line with a semicolon ";", so that the whole line will be ignored by the BrowserType object. The Browscap.ini File can be divided into two sections. One is for the data entries for any number of browsers. The other is for default entries for the default browser setting starting with the keyword "Default Browser Capability Settings" The change in a Browscap.ini File may need to restart the IIS services in ordered to make the changes become effective. Syntax
([; comments])* Parameters[...] The parameter "[" & "]" is the indicator of the bracketed parameters by a pair of square brackets "[...]" is an optional item unless other specified. (...)* The parameter "*" is the indicator of the bracketed property parameters by a pair of brackets "(...)" can be repeated zero or more times. (...)+ The parameter "+" is the indicator of the bracketed property parameters by a pair of brackets "(...)" can be repeated one or more times. (...)? The parameter "?" is the indicator of the bracketed property parameters by a pair of brackets "(...)" can be zero or one time ; The optional parameter ";" is the indictor of a comment line placing on the starting of a line that will be ignored by the BrowserType object. comments The optional parameter "comments" is used to specify the content of a comment on the same line. [HTTPUserAgentHeader] The square bracketed parameter "HTTPUserAgentHeader" is used to specify the unique value of the HTTP user agent header of a browser that to be associated with the properties of browser declared in the property parameter. There can be zero or more browser entries in the Browscap.ine file , but each should be starting with a unique HTTPUserAgentHeader value. When specifying the value in HTTPUserAgentHeader, a asterisk (*) character can be used as a wildcard character to replace zero or more characters and a question mark (?) character can be used as a wildcard character to replace a single character. For example, string in the HTTPUserAgentHeader: [Mozilla/4.0 (compatible; MSIE 5.0;* Windows NT)] can be used for matching with the user browsers:
[Mozilla/4.0 (compatible; MSIE 5.0; Windows NT)]
However, the BrowserType object will attempt to match the HTTP User Agent header of the user browser to the value HTTPUserAgentHeader exactly first. if that fails, the BrowserType object will continue the matching process with wildcard characters. When applying the wildcard character, the BrowserType object uses the closest match strategy, the matching of the HTTP User Agent header value of the user browser with the fewest characters replacement to select the closest entry of in the Browscap.ini. Therefore when more than one HTTPUserAgentHeader in the Browscap.ini containing wildcard characters is matched with the HTTP User Agent header of the user browser, the BrowserType object will only return the properties of the HTTPUserAgentHeader entry of closest match. browserDefinition The optional parameter "browserDefinition" is used to specify the "HTTP User Agent header" string of a browser that to be referenced as the parent browser. When the optional parameter "browserDefinition" is specified, the properties of the current specified browser will inherit all of the property values declared in the parent browser's definition. And values of these inherited properties can be replaced by a new value through setting the corresponding parameter propety explicitly. These optional parameter is mainly used for defining a new version of a browser from the previous version because a new version usually retains most of the properties of the previous release. propertyN The optional parameter "propertyN" is used to specify the name of a browser property that to be set. The name of a browser property must be started with an alphabetic character and cannot excess 255 characters. some possible properties are:
ActiveXControls: to specify supporting ActiveX Controls or not In the Browscap.ini file, the number of statements of property values can be specified as many as needed in each browser entry. But the Browscap.ini file can also contain only the properties which are needed by the application and should be known whether the user browser supported or not. For example, if an application only supports a Cookies supported browser, the Browscap.ini file only needs one property statment for each browser entry. [Default Browser Capability Settings] The square bracketed parameter "Default Browser Capability Settings" is used to specify the unique value of the HTTP user agent header of the default browser that to be associated with the properties of the default browser declared in the property parameter. There can only be one default browser entry in the Browscap.ine file. Usually a single asterisk (*) character is used as the HTTP user agent header for the default browser capability settings so that the default property settings can be applied to any user browser when there is no closest entry is found in the "HTTPUserAgentHeader" section. Examples
Retrieving Browser Capabilities from a Cookie For IEIn IIS 5.0, the client capabilities can be determined through retrieving a cookie, BrowsCap, describing browser capabilities of the user obtained by the javascript STYLE behavior as part of the request from the client initiated by a METADATA#metatag, the ASP page can then create an instance of the Browser Capabilities component that adds the name value pairs specified by the cookie as properties of the BrowserType object. However, this technique does not work with file redirected from Server.Transfer or Server.Execute methods because the METADATA#metatag in the redirected file will be ignored by the IIS if the file is a redirection from a Server.Transfer or Server.Execute methods and while other parts of the file will be processed normally. For example, a file, createcap.asp is used to create an instance of the BrowserType object of the browser capabilities of the user browser and display the browser capabilities of the user browser on the web page. In order to retrieving the cookie from the user browser, an additional file, getcookie.htm is needed to run on the client and determine the list of browser capability properties of the client using DHTML. And the technique used to run the file, getcookie.htm automatically on the client is by inserting a METADATA#metatag before running the contents of the file.
Browser Capabilities displaying ASP Page, createcap.asp:
<!--METADATA TYPE="Cookie" NAME="BrowsCap" SRC="getcookie.htm"-->
Browser Capabilities retrieving WebASP Page,
getcookie.htm:
<HTML> ©sideway ID: 130200005 Last Updated: 2/11/2013 Revision: 0 Ref: References
Latest Updated Links
|
Home 5 Business Management HBR 3 Information Recreation Hobbies 8 Culture Chinese 1097 English 339 Reference 79 Computer Hardware 249 Software Application 213 Digitization 32 Latex 52 Manim 205 KB 1 Numeric 19 Programming Web 289 Unicode 504 HTML 66 CSS 65 SVG 46 ASP.NET 270 OS 429 DeskTop 7 Python 72 Knowledge Mathematics Formulas 8 Set 1 Logic 1 Algebra 84 Number Theory 206 Trigonometry 31 Geometry 34 Calculus 67 Engineering Tables 8 Mechanical Rigid Bodies Statics 92 Dynamics 37 Fluid 5 Control Acoustics 19 Natural Sciences Matter 1 Electric 27 Biology 1 |
Copyright © 2000-2024 Sideway . All rights reserved Disclaimers last modified on 06 September 2019