MSWC.ContentRotator component

In order to use this component we need a file with the contents we want to rotate in our page. Each code will be separated by "%%" as shown in the example bellow. Somehow, we may consider this file as our database containing all our codes.

Contentrotator.txt
%%
AA

%% 
BB

%%
CC

%%
DD

 
In the example above, the different contents are "AA", "BB", "CC" and "DD", but they me be the codes necessary to run banners, news, other links or whatever. In the example above all codes will be display with the same frecuency.

In case we want to display different codes with different frecuencies, we will need to write the relative frecuency of each code as shown in the next example:

Contentrotator2.txt
%% #1
AA

%% #2 
BB

%% #3
CC

%% #4
DD

As a consecuence, each time "AA" is displaied, "BB" will be displayed twice, "CC" three times and "DD" four times.

Our last step is to insert the apropiate code in our page to allow those codes to be shown in our page.  You will find the code in the page bellow.

Contentrotator.asp
<html>
<body>

<%
set Showcode=server.createobject("MSWC.ContentRotator")
response.write(Showcode.ChooseContent("/cgi-bin/contentrotator.txt"))
%>

</body>
</html>

AspTutorial.info.