Posted by Adam Buenz

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.

15 Responses to “AJAX SharePoint List Rotator WebPart”

  1. Blogger Loser » Blog Archive » AJAX SharePoint List Rotator WebPart Says:

    […] 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) […]

  2. 10 Links Today (2007-08-29) Says:

    […] AJAX SharePoint List Rotator WebPart rotates through list items to display one, formatted […]

  3. Links (8/30/2007) « Steve Pietrek’s SharePoint Stuff Says:

    […] AJAX SharePoint List Rotator WebPart […]

  4. Adam Says:

    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.

  5. Adam Buenz Says:

    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
    www.thescripts.com/forum/thread586766.html
    forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1942896&SiteID=1

  6. Loke Kit Kai Says:

    Do you intend to release the source?

  7. Adam Buenz Says:

    I think I will, I just have to add the comments to the solution file.

  8. William Says:

    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?

  9. Adam Buenz Says:

    It should work just fine, let me verify the solution package quickly to make sure that the upload was the correct version.

  10. Gavin Pollock Says:

    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

  11. ASP.NET AJAX Support in WSS 3.0 and MOSS 2007 SP1 - Noticias externas Says:

    […] 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. :) […]

  12. MSDN Blog Postings » ASP.NET AJAX Support in WSS 3.0 and MOSS 2007 SP1 Says:

    […] 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. […]

  13. SharePoint, SharePoint and stuff : SharePoint Kaffeetasse 35 Says:

    […] AJAX SharePoint List Rotator WebPart […]

  14. Zlatan Says:

    No Source Code??!?

  15. basha Says:

    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.

Leave a Reply