ASP Content Rotator (ASP 3.0)

ASP Content Rotator Component

The ASP Content Rotator component creates a ContentRotator object that displays a different HTML content string each time a user enters or refreshes a page. A text file, called the Content Schedule File, includes the information about the content strings.
The content strings can contain HTML tags so you can display any type of content that HTML can represent: text, images, colors, or hyperlinks.


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

The following example displays a different content each time a user views the Web page. Create a text file named "textads.txt" in your default Web Site folder, in a subfolder called text.

%% #1
This is a great day!!

%% #2

%% #3
<img src="smiley.gif">

%% #4
Here's a <a href="">link.</a>

Notice the #number at the beginning of each content string. This number is an optional parameter that indicates the relative weight of the HTML content string. In this example, the Content Rotator will display the first content string one-tenth of the time, the second string two-tenths of the time, the third string three-tenths of the time, and the fourth string four-tenths of the time.

Then, create an ASP file, and insert the following code:


set cr=server.createobject("MSWC.ContentRotator")

ASP Content Rotator (ASP 3.0) Reviewed by 1000sourcecodes on 09:12 Rating: 5
Powered by Blogger.