Rating: No reviews yet
Downloads: 61
Released: Sep 8, 2008
Updated: Sep 9, 2008 by akennel
Dev status: -not yet defined by owner-

Recommended Download

Source Code Complete Project Folder
source code, 52K, uploaded Sep 9, 2008 - 25 downloads

Other Available Downloads

Application RandomImageWebPart.dll
application, 16K, uploaded Sep 8, 2008 - 19 downloads
Source Code Source
source code, 4K, uploaded Sep 8, 2008 - 17 downloads

Release Notes

Third release version. This was a ground-up rewrite. If you installed the previous version, you'll need to edit your web.config as the PublicKeyToken has changed. Sorry about that. I'll try not to change the Public Key again.

I fixed some of my logic to improve performance. When I first wrote this web part, I had it create an array to store the name of every image in the library, then chose one at random. If you have a very large Picture Library, this might cause a delay while all the image names are read. In this version, I don't bother with the array. I just get a count of the total number of pictures, then choose one at random. That should be much faster and use a little less memory.

I've also added a line of code so that the Alt Text for the image now shows the Title of picture, if one has been set.

I'm still not doing any size limitations on this release, so if one of your pictures is 1,280x1,024, it's going to fill the screen. I'll see if I can resize things on the fly in the future.

To install, copy the dll to your server's GAC. On most computers this will be c:\windows\assembly.
Edit the web.config for the web app that you want to add the web part to. This will usually be c:\inetpub\wwwroot\wss\VirtualDirectories\80\web.config. Add the following line to your list of Safe Controls:

<SafeControl Assembly="RandomImageWebPart, Version=, Culture=neutral, PublicKeyToken=9f4da00116c38ec5" Namespace="RandomImageWebPart" TypeName="RandomImageWebPart" Safe="True" />

Please note that the Safe Control entry has changed from the first 2 releases. If you've installed an older copy, you'll need to replace the line in your web.config with the new text that appears above.

Recycle IIS by typing "iisreset" at the command line.
You'll need to add the Web Part to your Site Collection's Web Part gallery before you can add it to a page. Once you've added the web part to your page, you'll need to modify the web part properties to tell it the name of your Picture Library. Just type the name of the library as it appears on your site, spaces in the name are OK.

Reviews for this release

No reviews yet for this release.