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 -
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.