home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_06.cab / samp4v5e.asp < prev    next >
Text File  |  1997-10-15  |  4KB  |  44 lines

  1.  <% If Request("DontFrame")<>1 Then Response.Redirect "/iissamples/sdk/asp/docs/SampFram.asp?ovfile=/iishelp/iis/htm/sdk/samp4v5e.asp&srcfile=Components/AdRotator" %>
  2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
  3. <HTML>
  4. <HEAD>
  5. <META HTTP-EQUIV="Content-Type" Content="text-html; charset=Windows-1252">
  6. <title>Ad Rotator</title>
  7. <script language="JavaScript">
  8.  
  9.     szNavVersion = navigator.appVersion
  10.  
  11.     if (navigator.appName == "Microsoft Internet Explorer") {
  12.     if (szNavVersion.indexOf ("4.") >= 0) {
  13.         document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie4.css">');
  14.     } else {
  15.         document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie3.css">');
  16.     }
  17.     }
  18.     else if (navigator.appName == "Netscape") {
  19.     document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie4.css">');
  20.     }
  21.     else {
  22.     document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie3.css">');
  23.     }
  24.  
  25. </script>
  26. <META NAME="DESCRIPTION" CONTENT="Internet Information Server reference information"></HEAD>
  27. <BODY BGCOLOR=#FFFFFF TEXT=#000000>
  28. <font face="Verdana, Arial, Helvetica">
  29. <h3><a name="_ad_rotator"></a>Ad Rotator</h3>
  30. <p>
  31. The Ad Rotator component creates an <b>AdRotator</b> object that automates the rotation of advertisement images on a Web page. The component is designed to enable you to display a new advertisement each time a client browser opens or reloads a Web page. </p>
  32. <p>
  33. This sample demonstrates how to use the Ad Rotator component. The script itself is simple, creating an instance of the <b>AdRotator</b> object and calling the <b>GetAdvertisement</b> method each time the page is loaded. <b>GetAdvertisement</b> returns a single ad entry from the Ad Rotator schedule file, adrot.txt in this example, and the special script delimiter <% = ... %> displays the results to the client browser. </p>
  34. <p>
  35. The schedule file for this sample, adrot.txt, is relatively straightforward. The four lines above the asterisk (*) are global file settings that affect all schedule entries in the file. The most interesting and useful global setting is the redirection specification. In this sample, if a user clicks on the advertisement, no matter which particular entry is currently displayed, they will be transported to the .asp file indicated. These scripts, or DLLs, usually count how many hits a given ad has received, collect user information, and then extract the URL from the request and redirect the client browser once again to the URL they originally requested.</p>
  36. <p>
  37. Each of the entries that occurs below the asterisk consist of four lines, denoting the image to be displayed, hyperlink, alternate text, and the relative probability that that particular entry will be displayed on any given visit to that Web page. Thus, the Microsoft® Internet Information Server site has an 80 percent chance of being displayed with each hit on that page, while the Microsoft Internet Explorer site only will be displayed for 20 percent of the hits. </p>
  38. <p>
  39. <b>Note</b>  If an advertisement entry in the schedule file does not have a corresponding URL, the hyperlink line of the entry must contain a hyphen (-) or the Ad Rotator component will return an error. </p>
  40. <hr class="iis" size="1">
  41. <p align="center"><em><a href="/iishelp/common/colegal.htm">© 1997 by Microsoft Corporation. All rights reserved.</a></em></p>
  42. </BODY>
  43. </HTML>
  44.