July 2000
Intermediate to advanced
492 pages
14h 53m
English
The following code demonstrates a complete Ad Rotator example to illustrate the overall mechanism of the Ad Rotator and its accessory files.
The first file, SampleHome.ASP, is the originally requested page containing the ad component. After the ad component retrieves it from the rotator schedule, this page also contains the ad.
<% ' +------------------------------------+ ' | SAMPLEHOME.ASP | ' +------------------------------------+ %> <HTML> <HEAD><TITLE>Ad Rotator Sample</TITLE></HEAD> <BODY BGCOLOR = #ffffcc> <% ' Dimension local variables. Dim adrotSample Dim strAdRotSchedFile Dim strAdString Set adrotSample = Server.CreateObject("MSWC.AdRotator") ' Set the ad to have no border. adrotSample.Border = 0 ' Set the ad so that its corresponding URL is loaded ' into a second, blank browser window. adrotSample.TargetFrame = "_blank" ' No need to set the Clickable property to True. It is ' the default. If we wanted to temporarily change this ' page's ad so that it was informational only, we ' could uncomment the next line. 'adrotSample.Clickable = False ' Retrieve the ad graphic html code (in this case it ' will be "/ads/graphics/FootTown.gif" with a URL of ' "http://www.foottownusa.com/info/introshoes.html." ' (See the sample rotator schedule file for more ' details on this ad.) strAdRotSchedFile = "/ads/rotshed.txt" strAdString = adrotSample.GetAdvertisement(strAdRotSchedFile) %> <HR> <%= strAdString%> <HR> Welcome to the shoes outlet page. Please visit our sponsors ...Read now
Unlock full access