image\cslogo3d1.gif

ASP Ad Rotator Component GetAdvertisement Method

The GetAdvertisement method retrieves the next advertisement from the Rotator Schedule file. Each time the script is run, such as when a user opens or refreshes a page, the method retrieves the next scheduled advertisement.

Arguments: ASP Ad Rotator Component GetAdvertisement Method

rotationSchedulePath

Specifies the location of the Rotator Schedule file relative to the virtual directory. For example, if the physical path was C:\Inetpub\Wwwroot\Ads\Adrot.txt (where Wwwroot is the "/" virtual directory), you would specify the path \Ads\Adrot.txt.

Return Values: ASP Ad Rotator Component GetAdvertisement Method

Returns HTML that displays the advertisement in the current page.

Examples: ASP Ad Rotator Component GetAdvertisement Method

The following example gets an advertisement from the Adrot.txt file in the /Ads/ virtual directory.

<% Set NextAd = Server.CreateObject("MSWC.AdRotator") %>

<%= NextAd.GetAdvertisement("/ads/adrot.txt") %>

Examples: ASP Ad Rotator Component GetAdvertisement Method HTML Output

Assuming the following fragment of a redirection file is chosen by the control:

 REDIRECT /foo/bar.asp

 WIDTH 300

 HEIGHT 40

 BORDER 1

 *

 /ads/picture.gif

 http://www.chilisoft.com/info/index.html

 Hello from Chilisoft.

 90

The HTML that is produced is:

<A HREF= "/foo/bar.asp?url=http://www.chilisoft.com/info/index.html&image=/ads/picture.gif TARGET="_blank"> 

<IMG SRC="/ads/picture.gif" ALT="Hello from Chilisoft" WIDTH=300 HEIGHT=40 BORDER = 1>

</A>

The Redirect script "foo/bar.asp" is invoked and can record click-through information before redirecting the client browser to the user’s desired location.

Copyright 2001 Sun Microsystems, Inc. All rights reserved. Legal Notice.