ASP Content Rotator (ASP 3.0)
Examples
The Content Rotator Component
This component displays a different HTML content string each time a user visits or refreshes the page.
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.
Syntax
<%
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.
"textads.txt":
%% #1
This is a great day!!
%% #2
<h1>Smile</h1>
%% #3
<img src="smiley.gif">
%% #4
Here's a <a href="http://www.w3schools.com">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:
<html>
<body>
<%
set cr=server.createobject("MSWC.ContentRotator")
response.write(cr.ChooseContent("text/textads.txt"))
%>
</body>
</html> |
The ASP Content Rotator Component's methods are described below:
Methods
| Method |
Description |
Example |
| ChooseContent |
Gets and displays a content string |
<%
dim cr
Set cr=Server.CreateObject("MSWC.ContentRotator")
response.write(cr.ChooseContent("text/textads.txt"))
%>Output:
 |
| GetAllContent |
Retrieves and displays all of the content strings in the text file |
<%
dim cr
Set cr=Server.CreateObject("MSWC.ContentRotator")
response.write(cr.GetAllContent("text/textads.txt"))
%>Output:
This is a great day!!
Smile

Here's a link.
|
The Ektron Intranet
lets you do everything you need to do on your corporate intranet and everything you want to do... all with just one application.
What can you do with the Ektron Intranet? |

|
Navigate through content, documents, assets, colleagues and workgroups quickly and intuitively with enterprise search |

|
Communicate with friends and colleagues with forums, message boards and corporate blogging using the new Social Networking Platform |

|
Promote collaboration among coworkers in your organization through project workspaces where others can efficiently find information and work together |

|
Personalize your company profile by bookmarking and organizing favorite content, uploading assets, posting photos, blogging, and more |

|
Interact with features like tagging, flagging, wikis and ratings found in the Web 2.0 Toolbox |
 |
Author/edit content, manage navigation, menus, audit trails, workflow and approvals with the best in breed Content Management |
|
|
|
|
See why there are 20,000+ Ektron integrations worldwide. Request an
INSTANT DEMO or download a
FREE TRIAL today. |
|