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

Rotating Content

Rotating Content

 

Introduction

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.com">ASPAlliance</a>

%% //Content 2
<a href="devdex.com">DevelopersDex</a>

%% //Content 3
<a href="aspalliance.com/wisemonk">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")
Response.Write(rotating.ChoseContent("rotate.txt")
%>

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-2017 ASPAlliance.com  |  Page Processed at 2017-07-23 12:45:11 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search