Name

GetAdvertisement — objAdRot.GetAdvertisement( strAdScheduleFile )

Synopsis

Retrieves the pertinent information for the next advertisement from the Ad Rotator schedule file.

From this file, GetAdvertisement retrieves general information about the ad (size, default border size, etc.). The call to the GetAdvertisement method also retrieves information about the specific ad that is selected (according to weights) from the schedule file.

For more information about the Ad Rotator schedule file and about the relative weights for the various ads in it, see the discussion on the Ad Rotator schedule file earlier in this chapter.

Once the GetAdvertisement method has retrieved this information, the Ad Rotator object creates the HTML for the ad that is sent to the client.

Parameters

strAdScheduleFile

A string value that represents the full virtual path or the path relative to the current virtual directory for the ad schedule file. For example, suppose the current virtual path is /search and this can be resolved to the physical path c:\inetpub\apps\search. If you specify the strAdScheduleFile parameter as /search/AdSched.txt, the Ad Rotator object will look for c:\inetpub\apps\search\AdSched.txt .

Example

<% ' The following code instantiates the Ad Rotator 'object, then retrieves and displays an ad from 'the AdRotSched.txt file. Dim objAdRot Set objAdRot = Server.CreateObject("MSWC.AdRotator") ' Display the ad in the HTML sent to the client. Note that ' the following line of code inserts the value ...

Get ASP in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.