Content Rotator Component

The Content Rotator component creates a ContentRotator 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 Content Schedule File.

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.

The following files are used by the Content Rotator component:

File Name Description
Controt.dll The Content Rotator component.
Content Schedule File 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.

Syntax

Set oVar = Server.CreateObject( "MSWC.ContentRotator" )

 

Parameters
oVar
Specifies the name of the ContentRotator object created by the call to Server.CreateObject.
Methods
ChooseContent Retrieves and displays a content string.
GetAllContent Retrieves and displays all the content strings in the Content Schedule file.

Remarks

Because the ContentRotator object 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.

Example

The following example displays a different tip of the day each time a user views the Web page.

<% 
  Set Tip = Server.CreateObject("MSWC.ContentRotator") 
  Response.Write NextTip.ChooseContent("/Tips/Content.txt") 
%>