AJAX SharePoint List Rotator WebPart
Sometimes, you want to rotate items out of a SharePoint list on a random basis in order to make this information available to your users, for example, some items that might be housed within your enterprise portal that would be helpful to rotate on something like your intranet frontpage displayed in no specified order are:
Technology Tips
Work Related Tips
Random Quotes
Company News
Upcoming Company Changes / Business Announcements
So, without further a due, a shocker of a WebPart, the AJAX Rotator WebPart.

The AJAX Rotator WebPart does what its name implies; it rotates things out of a SharePoint list. In order to eliminate a postback, it uses AJAX to load and rotate the items, nothing really fancy, but I needed a way to display task items randomly in a WebPart. To be honest I didn’t spend a lot of time on it because it was a nice to have thing, and not really used that heavily for my side project (I had under an hour to deliver it), so I just kinda whipped the damn thing out. It does take into account like object disposal etc., but I am sure some things could be cleaned up and other things introduced that would make it a little bit more applicable for other persons use. I dunno, I might be interested in doing something else with it, but hey, it was written on a whim really quick so I didn’t have the luxury of being that clever.
The AJAX Rotator WebPart is packaged within a SharePoint solution file (AjaxRotator.wsp) and the deploy.CMD file that will deploy your solution to your server. Once the solution if deployed, it is very, very easy to configure.
After successfully SharePoint Solution deployment On Your SharePoint Server:
Activate the SharePoint feature for the AJAX Rotator WebPart by going to the site collection features of the SharePoint instance by going to:
Site Actions -> Site Settings -> Site Collection Features -> activate the AJAX Rotator WebPart Feature
Once the feature is activated, add the WebPart to a WebPart page by going to Site Actions -> Edit Page
Once the WebPart is added, it must be configured by setting the WebPart properties, these are grouped under two sections, List Configuration and Labels and Message.
The first section is just the configuration options that are required, like the web where the list lives and the name of the list that should have its items rotated. There are some other configuration options that you can implement as well like if you want to pull a secondary field for display, and if there is a lot of characters that would normally be pulled from the secondary field, you can truncate that amount, if desired (you have to enable the truncation by selecting the checkbox). In this section you will also choose the rate of display that you would like items to be rotated in and out (I use 3000, but hey that’s just me).

The Labels and Messages section lets your adjust some of the textual interface components like the text that is used for the “read more” section, what text you want when items are loaded, etc. etc. etc They are pretty self explanatory.

I have only tested it with a task list, I haven’t tested it with any other types of lists. I am assuming because the code is kinda ambiguous it should work, but don’t get mad when it doesn’t. Like all the software that I release on this site, read the sharepointsecurity.com software disclaimer before you download it. (For those that don’t want to read it, it basically says this file and its parts is free for re-distribution, for use in both free and commercial applications, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.)
Anyhoo, you can download it here.
31 Comments »
RSS feed for comments on this post. TrackBack URL





















Articles & Research
SharePoint Architecture
Personal/Off-Topic
Latest Free SharePoint Software
SecureCenter For SharePoint
SharePoint Security Assurance Program™
Free Online SharePoint Security Tools
Online SharePoint Security Health Assessment
Article Or Research Filed Under 
[...] Sometimes, you want to rotate items out of a SharePoint list on a random basis in order to make this information available to your users, for example, some items that might be housed within your enterprise portal that would be helpful to rotate on something Read More……(read more) [...]
Pingback by Blogger Loser » Blog Archive » AJAX SharePoint List Rotator WebPart — August 29, 2007 @ 2:03 am
[...] AJAX SharePoint List Rotator WebPart rotates through list items to display one, formatted [...]
Pingback by 10 Links Today (2007-08-29) — August 29, 2007 @ 8:24 am
[...] AJAX SharePoint List Rotator WebPart [...]
Pingback by Links (8/30/2007) « Steve Pietrek’s SharePoint Stuff — August 30, 2007 @ 6:03 pm
This looks like a great webpart. I followed the install and it went well. Only problem is when I try to add it to a Team site, I get this error:
AJAX Rotator WebPart: Could not load file or assembly ‘System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35′ or one of its dependencies. The system cannot find the file specified.
Any thoughts? Thanks, I really hope I can use this web part. BTW, this is on a MOSS 2k7 Enterprise setup.
Comment by Adam — August 31, 2007 @ 1:37 pm
The System.Web.Extensions assembly is crucial to using AJAX within your SharePoint environment, which I am unsure whether it has been installed into your environment.
Here is a post that shows you how to install AJAX into your SharePoint environment.
http://sharepoint.microsoft.com/blogs/mike/Lists/Posts/Post.aspx?ID=3
It’s pretty simple, just install the AJAX package and then make some config changes, and you are ready to go. Here are some other links that target your error which I hope are helpful to you as well.
channel9.msdn.com/ShowPost.aspx?PostID=293825
http://www.thescripts.com/forum/thread586766.html
forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1942896&SiteID=1
Comment by Adam Buenz — September 1, 2007 @ 6:16 am
Do you intend to release the source?
Comment by Loke Kit Kai — September 9, 2007 @ 8:50 pm
I think I will, I just have to add the comments to the solution file.
Comment by Adam Buenz — September 20, 2007 @ 5:13 am
I am using WSS 3.0 and try to deploy the AjaxRotator.wsp file but it said “The file you imported is not valid. Verify that the file is a Web Part description file (*.webpart or *.dwp) and that it contains well-formed XML”. So do you have any suggestion on the problems?
Comment by William — September 25, 2007 @ 12:27 am
It should work just fine, let me verify the solution package quickly to make sure that the upload was the correct version.
Comment by Adam Buenz — September 25, 2007 @ 5:25 am
Any update on releasing the source? This looks way useful but I want to alter the functionality slightly to make the item displayed changeable using a dropdown, rather than a random display
Cheers
Gavin
Comment by Gavin Pollock — November 13, 2007 @ 10:45 am
[...] Adam Buenz SharePoint MVP created a web part which rotates a list in a free AJAX SharePoint list rotator web part. Good chance to get your feet wet. I also like that he puts it in a solution deployment package WSP file. Good practice.
[...]
Pingback by ASP.NET AJAX Support in WSS 3.0 and MOSS 2007 SP1 - Noticias externas — November 30, 2007 @ 3:07 am
[...] I was doing some searches for SP1 and noticed a number of references with anticipation for SP1 awaiting the big occasion. Here’s a couple of references: ASP.NET AJAX and SharePoint 2007 work together. Fitz even mentioned it a year ago in a post he did called Using ASP.NET AJAX in SharePoint sites: Tread lightly for now There have even been a couple of posts in anticipation of support on the team blog and Mike Ammerlaan’s blog on how to configure your SharePoint Server for ASP.NET AJAX including integration and performing the necessary installs and changes to your SharePoint Server and changes to the web.config to support ASP.NET AJAX Extensions. The SharePoint team blog has a preview of the information in SP1 that mentions that ASP.NET AJAX and creating custom web parts with the toolkit and extensions will be supported at SP1. “You can now use the Microsoft AJAX 1.0 Control toolkit for Microsoft ASP.NET or the AJAX 1.0 Extensions for ASP.NET to create Web Parts for asynchronous post pack. Beginning with WSS 3.0 SP1 and MOSS 2007 SP1, developers can create custom Web Parts using AJAX.” KB 941955 with a long title of “A Web Part that contains an ASP.NET AJAX 1.0 UpdatePanel control that uses the _doPostBack() function does not work when the URL of the hosting SharePoint Web site contains international characters.” This KB has a great workaround to prevent the a regular postback request occurs instead of an asynchronous ASP.NET AJAX postback request. The KB above includes code to add an UpdatePanel control to a Web Part and also uses the EnsureUpdatePanelFixups method to register the Script Manager control in the web part. Without the work around some caching of form actions and conflicts may occur. Although you won’t find any new ASP.NET AJAX in the features in the box, support for ASP.NET AJAX custom web parts does sound exciting to me. If you’re looking to build AJAX Solutions on SharePoint don’t miss the codeplex solution referred to as the SharePoint AJAX Toolkit by Daniel Larson SharePoint MVP Adam Buenz SharePoint MVP created a web part which rotates a list in a free AJAX SharePoint list rotator web part. Good chance to get your feet wet. I also like that he puts it in a solution deployment package WSP file. Good practice. Get ASP.NET 2.0 AJAX Extensions 1.0 at http://ajax.asp.net/This post originated from and is provided by the MSDN Blogs RSS feed. The original post of the article can be found here. [...]
Pingback by MSDN Blog Postings » ASP.NET AJAX Support in WSS 3.0 and MOSS 2007 SP1 — November 30, 2007 @ 3:15 am
[...] AJAX SharePoint List Rotator WebPart [...]
Pingback by SharePoint, SharePoint and stuff : SharePoint Kaffeetasse 35 — December 11, 2007 @ 11:04 am
No Source Code??!?
Comment by Zlatan — December 11, 2007 @ 4:30 pm
Dear Sir/Madam,
We have inhouse employees who have been working on .net with sharepoint.we will outsource these candidates to companies on contract basis.
waiting for your speedy reply.
Comment by basha — December 17, 2007 @ 6:23 am
Install went fine. However, upon configuration, could not get a response from any of the buttons (OK, Cancel, Apply) in the web part mod part. Any ideas?
Comment by talamar — August 25, 2008 @ 1:57 pm
after adding the webpart & the list information , i was not able to see any output ,
the webpart keeps on displaying “Loading….”
Comment by amit — September 9, 2008 @ 10:53 pm
I like the concept and would love to see the source code.
The problem I’ve got is that the first list item is never shown and during the time it should show, it just displays “Loading” and then skips to the second listitem which it displays correctly. After that it just keeps rotating between the second and following items and never shows the first list item (or the “loading” message) again.
Still, I would like to see the source code to see if I could fix it. I also would like it to work with Image libraries, as it doesn’t seem to be able to do so now.
Thanks for your time.
Comment by RDC — September 22, 2008 @ 3:45 am
I like the web part… it does almost exactly what I need. However I need to change the information that is displayed, as well as the way it is displayed. Is there any way I can get the source code so I can modify it to meet our needs? Thanks in advance!
Comment by Michael — October 2, 2008 @ 5:54 pm
Good webpart sir! Are you planning to release the code soon? I have noticed few other people have requested for the code. please let us know.
Thanks
Comment by AAM — October 15, 2008 @ 8:42 am
I’d like to check out this code; i’m writing about doing AJAX related sharepoint features here: http://point2share.wordpress.com/
Comment by pointsharing — October 30, 2008 @ 5:23 pm
[...] AJAX SharePoint List Rotator WebPart [...]
Pingback by Links (8/30/2007) « Steve Pietrek - Everything SharePoint — November 13, 2008 @ 5:40 pm
Many thanks! It worked perfectly on my blog
Comment by share point — January 2, 2009 @ 2:24 am
[...] RE: Anuncios rotatorios Hola, LSH: Cada vez pides cosas mas dificiles… Mira a ver si esto te puede servir. Utiliza Ajax, supongo que no ser un problema… http://www.sharepointsecurity.com/bl…tator-webpart/ Por cierto, yo lo instale en un sharepoint 2007 en ingles y muy bien. No lo he probado en espaol… "LSH" wrote: > Buenas tardes, tengo una serie de anuncios o noticias pero quiero hacerlas > rotatorias que cambien cada 10 segundos en la pagina, como hago esto? > > > Gracias > > « Crear Carpeta | Apertura de nuevas ventanas desde el menu vinculos de la pagina principal del portal » [...]
Pingback by Anuncios rotatorios | hilpers — January 20, 2009 @ 1:14 pm
after adding the webpart & the list information , i’m not able to see any output , the webpart keeps on displaying “Loading….” im not sure if im missing something, can anyone help
Comment by david — February 9, 2009 @ 12:35 pm
Hi Adam,
This is a fantastic work! We’d would love to see the source code. Wondering when would it be realeased? It seems like Loke first reqeusted it a year ago.
Comment by Sam — March 10, 2009 @ 12:59 am
Where is source code?
Comment by Marcin — March 24, 2009 @ 6:27 am
This looks like a very interesting webpart, I also would like to see the source before actually deploying it on our dev/staging server…
Comment by Robin Majumdar — May 14, 2009 @ 7:55 am
This seems to be doing the same thing one of the users was experiencing above on our server:
“The problem I’ve got is that the first list item is never shown and during the time it should show, it just displays “Loading” and then skips to the second listitem which it displays correctly. After that it just keeps rotating between the second and following items and never shows the first list item (or the “loading” message) again.”
Also, the AJAX seems to be refreshing the entire browser screen and not just the web part’s display.
Any thoughts? I am using this web part with a Custom List and not a Task list, but I am going to try a task list just to see if it makes a difference.
Comment by Mike Arsenault — October 13, 2009 @ 8:13 pm
Great post. It would be better if you can explain how it works…
Comment by Chanakya Jayabalan — December 2, 2009 @ 1:58 am
Are you planning on releasing the source code for this?
Teddi
Comment by Teddi Easlon — December 9, 2009 @ 3:22 pm