AspAlliance.com LogoASPAlliance: Articles, reviews, and samples for .NET Developers
URL:
http://aspalliance.com/articleViewer.aspx?aId=169&pId=-1
Rotating Content
page
by . .
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 9147/ 15

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.

 


Product Spotlight
Product Spotlight 

©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-04-19 7:16:30 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search