Link:http://output.to/sideway/default.asp?qno=130200003 ASP Server Component, Pre-made Function, Ad Rotator Component 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. Ad Rotator ComponentThe Ad Rotator component can be used to create an AdRotator object that acts as a HTML tag holder on an ASP page for controlling the rotation of banner images to be displayed on a web page automatically. The function of the AdRotator object is to automate the displaying of a new banner image on the web page each time when an user opens or reloads the web page. A text file called Rotator Schedule File is used to store the information for controlling the way of the banner image to be displaced on the web page. There is another optional text file called Redirection File by setting the URL paramenter in the Rotator Schedule File for recording how many users click on each banner image through redirect users to the Redirection File. And each jump to an redirected URL will be recorded in the web server activity log. File NameThe file name of the Ad Rotator component is Adrot.dll. SyntaxSet AdRotatorName = Server.CreateObject( "MSWC.AdRotator" ) ParametersAdRotatorName The parameter "AdRotatorName" is the name assigned to the instance of the AdRotator object created by the call using the Server.CreateObject. RemarkThe Ad Rotator Component does not work with Internet Information Server 7 (IIS7). AdRotator.Border PropertyAdRotator.Border property is used to specify the size of the surrounding border when displaying the banner image for individual instance of the AdRotator object. SyntaxAdRotatorName.Border = size ParametersAdRotatorName The parameter "AdRotatorName" is the name of the instance of the AdRotator object to be set. size The parameter "size" is used to specifies the thickness of the border used to surround the displayed banner image. The default value is set in the header of Rotator Schedule file. AdRotator.Clickable PropertyAdRotator.Clickable property is used to specify whether the displayed banner image is a hyperlink or not. SyntaxAdRotatorName.Clickable = value ParametersAdRotatorName The parameter "AdRotatorName" is the name of the instance of the AdRotator object to be set. value The parameter "value" is used to specify whether the displayed banner image is a hyperlink or not. The default value is TRUE. And the possible values are: TRUE: to display the banner image as a hyperlink FALSE: to display the banner image as an image only AdRotator.TargetFrame PropertyAdRotator.TargetFrame property is used to specify the target frame in which the link should be loaded. The AdRotator.TargetFrame property act as the same function of the TARGET parameter used in an HTML anchor statement. SyntaxAdRotatorName.TargetFrame = frame ParametersAdRotatorName The parameter "AdRotatorName" is the name of the instance of the AdRotator object to be set. frame The parameter "frame" is used to specify the name of the frame in which to display the banner image. The default value is "NO FRAME". And the possible values are the keywords of HTML frame, such as _TOP, _NEW, _CHILD, _PARENT, or _BLANK. AdRotator.GetAdvertisement MethodAdRotator.GetAdvertisement Method is used to set up the HTML tag of the banner image on an ASP page by retrieving the information of the next scheduled banner image and the specification details of the scheduled banner ad from the text file, Rotator Schedule file and formats the banner image as HTML tag according the specifications received from the AdRotator properties and Rotator Schedule file. The script "AdRotator.GetAdvertisement" runs each time when a user opens or reload the page, and the AdRotator.GetAdvertisement method will retrieve a new next scheduled banner image each time. SyntaxAdRotatorName.GetAdvertisement( rotationSchedulePath ) ParametersAdRotatorName The parameter "AdRotatorName" is the name of the instance of the AdRotator object to be specify. rotationSchedulePath The parameter "rotationSchedulePath" is used to specify the virtual location of the Rotator Schedule file relative to the virtual directory. Rotator Schedule FileThe Rotator Schedule File is used to store the specification details of the scheduled banner ad and the information of the scheduled banner images for the AdRotator Object. The specification details of the scheduled banner ad relate to the redirect link if applicable, the dimension of the banner image, and the default border size in pixel. While the information of the scheduled banner images relate to the file location of the image, the relevance home page, the alternate text for the image, and time of display for each banner image. Therefore the rotator schedule file can be divided into two sections seperated by a line with an asterisk * only. The first section contains the optional global parameters for the banner ad and the second section contains the individual information and setting for each banner image. The Rotator Schedule File should be stored under the web server directory so that the Rotator Schedule file can be accessed through a virtual path. Each parameter or setting is stroed in one single line. Since the four parameters in first section is only an optional parameter, the whole line of entry can be ignore. If there is no global parameters setting in the first section, the AdRotator Object will use the default values for the new instance of the Ad Rototor object setup, and the line with just a single asterisk x becomes the first line of the Rotator Schedule file. But in the section, the parameters for each banner image is fixed at four line of entry, if there is home page of banner ad, a line with a single hyphen - should be entered. These four line of entry for each banner image will be repeated for every banner image in the banner ad. The change in a Rotator Schedule File may need to restart the IIS services in ordered to make the changes become effective. Syntax
[REDIRECT URL] Parameters* The parameter "*" is the separator of two sections only. [...] The parameter "[" & "]" is the indicator of the bracketed parameters by a pair of square brackets "[...]" is an optional item. (...)+ The parameter "+" is the indicator of the four bracketed parameters by a pair of brackets "(...)" can be repeated one or more times. URL The parameter "URL" is used to specify the path of redirection handling script on the web server to implement the control plan of redirection. The redirection handling script can be either dynamic-link library (.dll) or application file (.asp). The specified path can be either full URL path (http://...) or virtual path relative to the virtual directory (/...). numWidth The parameter "numWidth" is used to specify the width of the banner image displayed on the web page. The unit of the numWidth is in pixels and the default value is 440 pixels. numHeight The parameter "numHeight" is used to specify the height of the banner image displayed on the web page. The unit of the numHeight is in pixels and the default value is 60 pixels. numBorder The parameter "numBorder" is used to specify the thickness of the hyperlink border around the banner image. The unit of the numBorder is in pixels and the default value is 1 pixel. And the value of numBorder is set to 0 when there is no border around the banner image. adURL The parameter "adURL" is used to specify the location of the banner image file. adHomePageURL The parameter "adHomePageURL" is used to specify the link of associated home page of the banner image. A hyphen - is needed to put on this line when the banner image does not have a associated home page. Text The parameter "Text" is used to specify the alternate text to be displayed when the graphics capability of the browser is either not supported, or turned off. impressions The parameter "impressions" is used to specify the individual relative weight of the banner ad. Although a number between 0 and 10000 can be used for indicating the individual relative weight of the banner image, there is a limitation that the sum of the impressions for all item cannot exceed 10000, otherwise an error will be generated at the first time when the Rotator Schedule file is called by the GetAdvertisement method. The number 10000 is only the maximum total number of impressions for all items in a banner ad. The weighting mechanism for the impressions will only consider the total number of impressions for all items in the Rotator Schedule file. For example, if a Rotator Schedule file contains three ads with impressions set to 1, 3, and 4, the first advertisement is displayed 12.5 percent of the time, the second 37.5 percent of the time, and the third 50 percent of the time. Redirection FileThe Redirection file is an optional file to implement the control plan of redirection. The Redirection file can be either dynamic-link library (.dll) or application file (.asp) and is stored on the web server so that the Redirection file can be accessed by specifying either full URL path (http://...) or virtual path relative to the virtual directory (/...). The redirection handling script on the web server is activated by the AdRotator Object after the banner image is being clicked by the user. One common application of the redirection handling script in the Redirection file is to record the number of user click on each banner image. When the Redirection File is called by the AdRotator Object click, the AdRotator object also passes a QueryString to the Redirection File for parsing. There are two variables in the QueryString. One is called image that holds the file name of banner image. The other is called URL that holds the link of the associated home page of the banner image. The redirection handling script can make use of the query string sent by the AdRotator object to parse and to redirect the user to the URL associated with the banner image that the user clicked on. In the Redirection file, the redirection handling script can also be included script to count the number of users that have clicked on a particular banner image and store the counter to a file on the web server. Examples
Link:http://output.to/sideway/default.asp?qno=130200002 ASP Server Component ASP Server ComponentsUnlike build-in ASP Objects, an ASP component is an executable self contained code with specific functions designed for providing one or more objects by performing those specific functions within the component. In general, an object instance is collections of information with specific methods to carry out some predefined procedures for manipulating the properties of an instance of an object by modifying its attributes created by the execution of the corresponding asp component. An instance of the object can be created by assigning a new variable name to the ASP object provided by the ASP component using the ASP Server.CreateObject method. Since the ASP Server.CreateObject method needs the registered name of the ASP component, the ASP component should be registered before the ASP component can be used to provide ASP objects. The ASP built-in server components are provided to enhance the usability of ASP technology by adding some built-in components to increase the fundamental capability of ASP technology for creating dynamic and interactive web pages. Besides, there are also some base components to enrich the pre-made functions of ASP technology for making dynamic and interactive web pages. 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.
|
Sideway BICK Blog 06/02 |