2025-04-27 07:49:33 -04:00

121 lines
5.0 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=Windows-1252">
<TITLE>Content Rotator Component</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
TempString = navigator.appVersion
if (navigator.appName == "Microsoft Internet Explorer"){
// Check to see if browser is Microsoft
if (TempString.indexOf ("4.") >= 0){
// Check to see if it is IE 4
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/coua.css">');
}
else {
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/cocss.css">');
}
}
else if (navigator.appName == "Netscape") {
// Check to see if browser is Netscape
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/coua.css">');
}
else
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/cocss.css">');
//-->
</script>
<SCRIPT LANGUAGE="VBScript">
<!--
Sub Window_OnLoad()
Dim frmContents
On Error Resume Next
If Not Parent Is Nothing Then
Set frmContents = Parent.Contents
If Not frmContents Is Nothing Then
frmContents.Window.TOCSynch_Click
End If
End If
End Sub
//--></SCRIPT><META NAME="DESCRIPTION" CONTENT="Internet Information Services reference information">
<META HTTP-EQUIV="PICS-Label" CONTENT='(PICS-1.1 "<http://www.rsac.org/ratingsv01.html>" l comment "RSACi North America Server" by "inet@microsoft.com <mailto:inet@microsoft.com>" r (n 0 s 0 v 0 l 0))'>
<META NAME="MS.LOCALE" CONTENT="EN-US">
<META NAME="MS-IT-LOC" Content="Internet Information Services">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1><A NAME="_content_rotator_component"></A><SUP></SUP>Content Rotator Component</H1>
<P>The Content Rotator component creates a <B>ContentRotator</B> object that automatically rotates HTML content strings on a Web page. Each time a user requests the Web page, the object displays a new HTML content string based upon information that you specify in a <A HREF="/iishelp/iis/htm/asp/comp0mw5.htm">Content Schedule File</A>.</P>
<P>Because the content strings can contain HTML tags, you can display any type of content that HTML can represent: text, images, or hyperlinks. For example, you can use this component to rotate through a list of daily quotations or hyperlinks, or to change text and background colors each time the Web page is opened.</P>
<P>The following files are used by the Content Rotator component:</P>
<TABLE border=0 cellpadding=5 cols=2 frame=box rules=all>
<TR VALIGN="top">
<TD class=blue width=52%><B>File Name</B></TD>
<TD class=blue width=48%><B>Description</B></TD>
</TR>
<TR VALIGN="top">
<TD width=52%>Controt.dll </TD>
<TD width=48%>The Content Rotator component.</TD>
</TR>
<TR VALIGN="top">
<TD width=52%><A HREF="/iishelp/iis/htm/asp/comp0mw5.htm">Content Schedule File</A></TD>
<TD width=48%>A text file that contains the display schedule and file information for Web content. This file must be available on a Web server virtual path.</TD>
</TR>
</TABLE><BR>
<H6>Syntax</H6>
<P><B>Set </B><I>ContRot </I>=<B> Server.CreateObject( "MSWC.ContentRotator" ) </B></P>
<P>&nbsp;</P>
<H6>Parameters</H6>
<DL>
<DT><I>ContRot</I></DT>
<DD>Specifies the name of the <B>ContentRotator</B> object created by the call to <B>Server.CreateObject</B>.</DD>
</DL>
<H6>Methods</H6>
<TABLE border=0 cellpadding=5 cols=2 frame=box rules=all>
<TR VALIGN="top">
<TD width=48%><A HREF="/iishelp/iis/htm/asp/comp8r1w.htm">ChooseContent</A> </TD>
<TD width=52%>Retrieves and displays a content string.</TD>
</TR>
<TR VALIGN="top">
<TD width=48%><A HREF="/iishelp/iis/htm/asp/comp6fzo.htm">GetAllContent</A></TD>
<TD width=52%>Retrieves and displays all the content strings in the Content Schedule file.</TD>
</TR>
</TABLE><BR>
<P><span class=le><B>Note</B></span></P>
<P>Because the <U>Content Rotator Component</U> uses a random generator to select which of the weighted content strings is displayed, a string may be repeated. This is most likely to occur if there are few entries in the Content Schedule file, or if one entry is weighted much higher than the others.</P>
<H6>Example</H6>
<P>The following example displays a different tip of the day each time a user views the Web page. To run this example, you need to create the <U>Content Schedule File</U> in your Default Web Site folder, in a subfolder called Data.&nbsp; For example, if your Default Web Site is mapped to C:\Inetpub\Wwwroot, you need to create the list file in C:\Inetpub\Wwwroot\Data\ContRot.txt.</P>
<P>--- ContRot.asp ---</P>
<PRE><CODE>&lt;%
Set objContRot = Server.CreateObject("MSWC.ContentRotator")
%&gt;
&lt;%= objContRot.ChooseContent("/Data/ContRot.txt") %&gt;
</CODE></PRE>
<hr class="iis" size="1">
<p align="center"><em><a href="../../../common/colegal.htm">&copy; 1997-2001 Microsoft Corporation. All rights reserved.</a></em></p>
</BODY>
</HTML>