Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

How to use the ASP ContentRotator object in FrontPage 2002


View products that this article applies to.

This article was previously published under Q318282

↑ Back to the top


Summary

Use this step-by-step guide that describes how to use the Content Rotator installable component for Active Server Pages (ASP) in Microsoft FrontPage. The Content Rotator automates the rotation of HTML content strings on a Web page.

Creating a Content Schedule File

The Content Schedule file contains information that the ContentRotator object uses to manage and display the specified content. In an entry, the double percentage signs (%%) denote the separation of each content section and double slashes (//) indicate a comment. For additional information about the Content Schedule file, see the following Microsoft Web site:
1.Start FrontPage and then open a Web on a Web server running Internet Information Services (IIS).
2.On the Standard toolbar, click the New Page button.
3.Switch to HTML View.
4.On the Edit menu, click Select all. Press DELETE.
5.Type the following text:
%% // This is a simple text example:
Don't run with scissors.

%% // This is an example of a quotation:
If the past 20 years have been impressive, the next 20 will be astounding.<br><br>
--<i>Bill Gates</i>

%% // This example contains an image:
MSN - The Internet from Microsoft<br>
<img src="http://msimg.com/w/logo.gif">

%% // This example contains a URL:
Where do you want to go today?<br>
<a href="http://www.microsoft.com">www.microsoft.com</a>
					
6.On the File menu, click Save.
7.Name the file ContentRotator.txt.
8.In the Files of type list, click All Files (*.*).
9.Click Save.
10.On the File menu, click Close.

Creating a Page by Using the Content Rotator Component

1.On the Standard toolbar, click New Page to start a new page.
2.Switch to HTML View.
3.Insert the following code before the opening <BODY> tag:
<%
  Dim objContentRotator
  Set objContentRotator = Server.CreateObject("MSWC.ContentRotator") 
%>
						
This code creates a ContentRotator object for later use.
4.Switch back to Normal View.

Using the ContentRotator Object on the Page

1.Insert an HTML Markup Web component to add the ASP code that will use the ContentRotator object. To do this, perform the following steps:
a. On the Insert menu, click Web Component.
b. Click Advanced Controls for the component type.
c. Click HTML for the control.
d. Click Finish.
2.When the HTML Markup dialog box appears, type the following code:
<%=objContentRotator.ChooseContent("/ContentRotator.txt")%>
						
This ASP code retrieves a text entry from the content schedule file you created earlier.
3.Click OK to close the HTML Markup dialog box.

Saving and Previewing the Page

1.On the File menu, click Save.
2.Name the file ContentRotatorTest.asp and click Save.
3.On the File menu, click Preview in Browser.
4.Click Preview.
You should see the text change as you refresh the page in your browser.

NOTE: If you change the fonts or colors for the page, the text output from the ContentRotator object also changes.

For more information about about how to change the fonts or the colors, click Microsoft FrontPage Help on the Help menu, type fonts or colors in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

MORE INFORMATION

ASP for IIS comes with several built-in objects, such as the Response and Request objects. In addition to these objects, IIS comes with several installable components that you can use with ASP.

↑ Back to the top


References

For more information about how to create rotating advertisements, visit the following Microsoft Web site:

↑ Back to the top


Keywords: KB318282, kbhowtomaster, kbhowto

↑ Back to the top

Article Info
Article ID : 318282
Revision : 5
Created on : 3/29/2007
Published on : 3/29/2007
Exists online : False
Views : 335