Wednesday, September 21, 2005
« IE Debugging Made Easier | Main | Performance of Beethoven's 9th »

[EDIT: 07/10/2006 - Fixed stupid spelling error]

I created a very simply control the last night that might come in handy to someone.  If you've ever had the need to have a series of images cycle at some interval on your webpage then this might be useful.  The script to create such functionality on your site is quite trivial (though perhaps it gets slightly more redundant and complicated if you need multiple, distinct, rotating images on your page simultaneously, each with a varying interval between switching images).  However, I wanted to have an ASP.NET control that I could just drop on a page, set up its sequence of images, have it work, and call it good.

Well, I've created a control called ImageRotator that provides this functionality.  Simply add the control library (dll) your website's \bin directory, create the little markup needed, and you're up and running.  The .zip file contains the full source (which really isn't much at all) and the 'release-build' bits for both .NET 1.1 and 2.0, along with a readme tutorial on how to use it.

By way of example, in order to set it up on your page, all you have to do is this:

<%@ Register tagPrefix="devstone" namespace="Devstone.Web.WebControls" Assembly="ImageRotator" %>

<devstone:imagerotator id=imgRotator runat=server interval=3000>
   <devstone:imageref imageurl="~/images/image001.jpg" />
   <devstone:imageref imageurl="~/images/image002.jpg" />
   <devstone:imageref imageurl="~/images/image003.jpg" />
</devstone:imagerotator>

Pretty simple, but all it does is help solve a simple problem.

You can download the .zip file here.