Scott on Writing

Musings on technical writing...

Request for Comments: A ContentRotator Web Control

I am in the midst of building a custom ASP.NET server control I call skmContentRotator, which is similar in semantics and syntax to the AdRotator control.  Like the AdRotator, the ContentRotator has an XML-formatted file that spells out the content to rotate through.  The main difference between the two controls is that while the AdRotator randomly rotates through ads, the ContentRotator will rotate through arbitrary content.

In its simplest form, the ContentRotator would just allow vanilla HTML markup to be emitted.  Of course, ideally the control would allow for the content to be dynamically determined; for example, if you wanted to display some random welcome messages, you might want to include the current date/time, or the name of the currently logged on user.  Or if you ran an eCommerce site you might want to randomly display “hot deals,” which might entail displaying information about a random product from a subset of products (where the product information was stored in a database).

What do you think would be the best way to allow for this dynamic capability?  Right now, I'm leaning toward having any dynamic capability required to be wrapped up in a User Control, and then the page developer would reference the path to the User Control in the XML file that spells out the content to rotate through.  That is, say one of the random pieces of content you wanted to rotate through was a page that had a DataGrid with some products listed.  To accomplish this, you'd first create a User Control - call it RecentProducts.ascx - that had the required Web controls and source code.  Then, in the content file you'd add an item like:

<content contentPath=”~/RecentProudcts.ascx” />

On the other hand, if you just wanted to squirt in some static text into the rotation, you'd add a content item like:

<content>
  
static text
</content>

Any comments on this approach?  Are there any features for a content rotator you can think of that are must-have?  Any comments/suggestions appreciated.

posted on Tuesday, February 22, 2005 4:38 PM

Feedback

# re: Request for Comments: A ContentRotator Web Control 2/23/2005 7:43 AM gvishal

More like MSDN front page ..They have abilty to rotate the top 2 contents ..

# re: Request for Comments: A ContentRotator Web Control 2/23/2005 10:16 AM Helen

Could you make it so that it'll hook up to a list with a certain interface so that you could fill your list with content from a database or an XML file or a text file and then specify it as a datasource for the ContentRotator? It'd be less easy to use, but very, very flexible.

# re: Request for Comments: A ContentRotator Web Control 2/23/2005 2:13 PM Scott Mitchell

Helen, what I have currently done is allowed the ContentRotator's contents to be specified via an external XML-formatted file (like AdRotator). In addition, ContentRotator's content elements can be set declaratively and/or programmatically added, much like the DropDownList's Items collection can be set declaratively or programmatically.

# re: Request for Comments: A ContentRotator Web Control 3/6/2005 5:47 PM Phil Guerra

Scott,

Just got to this post on your blog. I've toyed with this idea from a slightly different perspective. I'm looking at creating RSSnewfeed Rotator, taking content from a newsfeed or list of newsfeeds and randomly going thru them displaying them like the MSN news site does. Only I think they are using some kind of script to do it. I think using RSSv2 with enclosures for media is the way I've been approaching it.

Does this sound like a similar thing to you?

# Comment Spam Script Gone Awry 3/6/2005 9:59 PM Scott on Writing

# re: Request for Comments: A ContentRotator Web Control 3/14/2005 11:27 AM Duncan Mackenzie

Allowing dynamic content as well as static is an interesting idea, mine only does static materials... http://msdn.microsoft.com/vbasic/default.aspx?pull=/library/en-us/dncodefun/html/code4fun09072004.asp

# re: Request for Comments: A ContentRotator Web Control 12/23/2007 11:56 PM ruslan

why you have implemented IStateManger in contetitem, could not we just use the ready use Viewstate that comes from Control class... seems its does do anything special apart from calling base class methods... am I missing something?
thanks

Title:  
Name:  
Url:
Protected by Clearscreen.SharpHIPEnter the code you see:
Comments   

My Links

Ads Via DevMavens

Archives

Post Categories

 

I am a Microsoft MVP for ASP.NET.
I am an ASPInsider.
<March 2010>
SMTWTFS
28123456
78910111213
14151617181920
21222324252627
28293031123
45678910

Comment Stats

DayTotal% of Total
Sunday 2056.8%
Monday 42514.1%
Tuesday 51917.2%
Wednesday 55618.4%
Thursday 58019.2%
Friday 54718.1%
Saturday 1886.2%
Total 3020100.0%

Hour1Total% of Total
12:00 AM 782.6%
1:00 AM 812.7%
2:00 AM 682.3%
3:00 AM 822.7%
4:00 AM 692.3%
5:00 AM 1264.2%
6:00 AM 1193.9%
7:00 AM 1816.0%
8:00 AM 1926.4%
9:00 AM 1585.2%
10:00 AM 1886.2%
11:00 AM 1936.4%
12:00 PM 2016.7%
1:00 PM 1846.1%
2:00 PM 1695.6%
3:00 PM 1354.5%
4:00 PM 1153.8%
5:00 PM 1073.5%
6:00 PM 1013.3%
7:00 PM 1073.5%
8:00 PM 923.0%
9:00 PM 882.9%
10:00 PM 913.0%
11:00 PM 953.1%
Total 3020100.0%

Comments by Blog Entry Date/Time

Day Entry MadeAvg.Total
Sunday 5.00160
Monday 4.80384
Tuesday 4.04477
Wednesday 7.39680
Thursday 6.26676
Friday 5.07466
Saturday 4.78177
Total 5.403020

Hour1 Entry MadeAvg.Total
12:00 AM 5.2937
1:00 AM 1.002
5:00 AM 0.000
7:00 AM 3.8550
8:00 AM 3.72134
9:00 AM 6.06297
10:00 AM 5.63276
11:00 AM 4.22194
12:00 PM 6.16351
1:00 PM 3.09133
2:00 PM 4.89230
3:00 PM 7.67322
4:00 PM 4.00108
5:00 PM 6.07170
6:00 PM 4.64116
7:00 PM 8.95188
8:00 PM 8.63164
9:00 PM 5.00115
10:00 PM 6.31101
11:00 PM 4.5732
Total 5.403020

Learn More About Comment Stats
1 - All times GMT -8...


Blog Stats

Favorite Web Sites

My Books

My MSDN Articles