How to use the ASP ContentRotator object in FrontPage 2002 (318282)



The information in this article applies to:

  • Microsoft FrontPage 2002

This article was previously published under Q318282

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.

back to the top

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.
back to the top

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.
back to the top

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:
    1. On the Insert menu, click Web Component.
    2. Click Advanced Controls for the component type.
    3. Click HTML for the control.
    4. 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.
back to the top

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.
back to the top

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:

Modification Type:MajorLast Reviewed:12/27/2004
Keywords:kbhowto kbHOWTOmaster KB318282