Rotating Content
page 1 of 1
Published: 13 Oct 2003
Unedited - Community Contributed
This article demonstrates the use of the ContentRotator component provided by Microsoft in Classic ASP.
by . .
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 9222/ 16

Rotating Content

Rotating Content



Microsoft included some components in ASP that shouldn't be ignored. Here is one of them, it allows you to rotate content on your pages.

How to use it

First, you need a page with the content on it.

%% //Content 1
<a href="">ASPAlliance</a>

%% //Content 2
<a href="">DevelopersDex</a>

%% //Content 3
<a href="">thisDevelopmentPage</a>

Save this as something like 'rotate.txt'. The %% signify a new block of HTML code to use, // are for coments.

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

This will chose a piece of code from that file and show it. You can use the GetAllContent() method to get all of the content in the file (all of the HTML content).

Another thing that you can do is set an impressions number like this -

%% #6 //Content 2

This set's how often the segment of code will be displayed. All segments have a default value of 1.

This component seems a lot like the AdRotator component doesn't it? The AdRotator does have a few more properties and methods that you can use though.


User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2024  |  Page Processed at 2024-02-25 3:48:26 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search