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

  1.  <% If Request("DontFrame")<>1 Then Response.Redirect "/iissamples/sdk/asp/docs/SampFram.asp?ovfile=/iishelp/iis/htm/sdk/samp6a7m.asp&srcfile=Components/ContentRotator" %>
  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>Content 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="_content_rotator"></a>Content Rotator</h3>
  30. <p>
  31. This example demonstrates how you can use the Content Rotator component to create dynamic, informative applications. Content Rotator allows you to develop a Web page that displays a new HTML content string each time the page is accessed by a client browser. </p>
  32. <p>
  33. This script first calls <b>Server.CreateObject</b> to create an instance of the <b>ContentRotator</b> object. The <b>ChooseContent</b> method of the <b>ContentRotator</b> object is then used to extract one content string from the content schedule file. </p>
  34. <p>
  35. This sample's schedule file, tiprot.txt, illustrates how easy it is to create a schedule file for the Content Rotator component. Basically, each entry is separated from the other entries by entry delimiters, %%. Comments, on lines with %% followed by // can explain any additional information required about an entry, and a relative weight, denoted by the # sign, can be assigned to each entry. For instance, if you assign the first entry a weight of 4, and a the second entry a weight of 6, the first entry will be displayed for the visiting client browser for 40 percent of the hits on that page, and the second entry will be displayed for 60 percent of the hits. </p>
  36. <p>
  37. Any string valid in HTML is valid in the schedule file. Thus, this example shows an unformatted text string, a formatted HTML string, and an <IMG> element pointing to a .gif file. Note that you could also include hyperlinks, tables, or anything else that makes up a Web page. </p>
  38. <p>
  39. <b>Note</b>  This component is not installed with IIS. You can install it from the Microsoft Web site at <a href="http://www.microsoft.com/iis/"><b>http://www.microsoft.com/iis/</b></a>, or from the CD included with the IIS Resource Kit. The ProgID declared by the component version installed from these sources specifies "IISSamples" in the vendor component of the ProgID, not "MSWC." Therefore, the <b>Server.CreateObject</b> invocation in this sample script must be modified to reflect the proper component ProgID.</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.