Sideway
output.to from Sideway
Draft for Information Only

Content

ASP Server Components
  Ad Rotator Component
    File Name
    Syntax
    Parameters
    Remark
   AdRotator.Border Property
    Syntax
    Parameters
   AdRotator.Clickable Property
    Syntax
    Parameters
   AdRotator.TargetFrame Property
    Syntax
    Parameters
   AdRotator.GetAdvertisement Method
    Syntax
    Parameters
   Rotator Schedule File
    Syntax
    Parameters
   Redirection File
   Examples

ASP Server Components

Some 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 Component

The 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 Name

The file name of the Ad Rotator component is Adrot.dll.

Syntax

Set AdRotatorName = Server.CreateObject( "MSWC.AdRotator" )

Parameters

AdRotatorName

The parameter "AdRotatorName" is the name assigned to the instance of the AdRotator object created by the call using the Server.CreateObject.

Remark

The Ad Rotator Component does not work with Internet Information Server 7 (IIS7).

AdRotator.Border Property

AdRotator.Border property is used to specify the size of the surrounding border when displaying the banner image for individual instance of the AdRotator object.

Syntax

AdRotatorName.Border = size

Parameters

AdRotatorName

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 Property

AdRotator.Clickable property is used to specify whether the displayed banner image is a hyperlink or not.

Syntax

AdRotatorName.Clickable = value

Parameters

AdRotatorName

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 Property

AdRotator.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.

Syntax

AdRotatorName.TargetFrame = frame

Parameters

AdRotatorName

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 Method

AdRotator.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.

Syntax

AdRotatorName.GetAdvertisement( rotationSchedulePath )

Parameters

AdRotatorName

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 File

The 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]
[WIDTH numWidth]
[HEIGHT numHeight]
[BORDER numBorder]
*
(adURL
adHomePageURL
Text
impressions)+

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 File

The 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

  • Example of an AdRotator Web page, named AdRotator.asp to display banner ad on AdRot_Schedule.txt with no border, no hyperlink, and displays on frame "target='_blank'"

    ASP Page, AdRotator.asp:

    <%
    Set ad = Server.CreateObject("MSWC.AdRotator")
    ad.Border = 0
    ad.Clickable = FALSE
    ad.TargetFrame ="target='_TOP'"
    Response.Write ad.GetAdvertisement("/ads/AdRot_Schedule.txt")
    %>

  • Example of Rotator Schedule File, named AdRot_Schedule.txt to store the specification details of the scheduled banner ad and the information of the scheduled banner images for the AdRotator Object. 

    Text in the Rotator Schedule File, AdRot_Schedule.txt:

    REDIRECT AdRot_Redirect.asp
    WIDTH 280
    HEIGHT 50
    BORDER 1
    *
    http://www.output.to/images/sideway.jpg
    http://www.output.to
    HomePage of Output.to
    1
    http://sideway.com.hk/images/pearl.gif
    -
    HomePage of Pearl PicBlog
    3
    http://www.sideway.hk/images/sideway.jpg
    http://www.sideway.hk
    HomePage of Sideway
    4 4

  • Example of Redirection File, named AdRot_Redirt.asp to store user information in Application variables and redirect the user to the home page of the associated banner image..

    ASP script command in the Redirection File, AdRot_Redirect.asp:

    <%
    Application.Lock
    Application("AdClicked") = Request.QueryString("image")
    Application("User") = Request.ServerVariables("REMOTE_ADDR")
    Application.UnLock
    Response.Redirect(Request.QueryString("url"))
    %>


©sideway

ID: 130200003 Last Updated: 8/2/2013 Revision: 0 Ref:

close

References

  1. Active Server Pages,  
  2. ASP Overview,  
  3. ASP Best Practices,  
  4. ASP Built-in Objects,  
  5. Response Object,  
  6. Request Object,  
  7. Server Object (IIS),  
  8. Application Object (IIS),  
  9. Session Object (IIS),  
  10. ASPError Object,  
  11. ObjectContext Object (IIS),  
  12. Debugging Global.asa Files,  
  13. How to: Debug Global.asa files,  
  14. Calling COM Components from ASP Pages,  
  15. IIS ASP Scripting Reference,  
  16. ASP Keywords,  
  17. Creating Simple ASP Pages,  
  18. Including Files in ASP Applications,  
  19. ASP Overview,  
  20. FileSystemObject Object,  
  21. http://msdn.microsoft.com/en-us/library/windows/desktop/ms675944(v=vs.85).aspx,  
  22. ADO Fundamentals,  
close

Latest Updated LinksValid XHTML 1.0 Transitional Valid CSS!Nu Html Checker Firefox53 Chromena IExplorerna
IMAGE

Home 5

Business

Management

HBR 3

Information

Recreation

Hobbies 7

Culture

Chinese 1097

English 337

Reference 67

Computer

Hardware 149

Software

Application 187

Digitization 24

Numeric 19

Programming

Web 757

CSS 1

ASP.NET 1

Regular Expression 1

HTML

Knowledge Base

Common Color 1

Html Entity (Unicode) 1

Html 401 Special 1

OS 389

MS Windows

Windows10 1

.NET Framework 1

DeskTop 7

Knowledge

Mathematics

Formulas 8

Algebra 20

Number Theory 206

Trigonometry 18

Geometry 18

Calculus 67

Complex Analysis 21

Engineering

Tables 8

Mechanical

Mechanics 1

Rigid Bodies

Statics 92

Dynamics 37

Fluid 5

Fluid Kinematics 5

Control

Process Control 1

Acoustics 19

FiniteElement 2

Physics

Electric 10

Biology 1

Geography 1


Copyright © 2000-2019 Sideway . All rights reserved Disclaimers last modified on 06 September 2019