Print Page | Close Window

random image rotator component using ASP?

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=13740
Printed Date: 30 March 2026 at 2:45pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: random image rotator component using ASP?
Posted By: sarumu1
Subject: random image rotator component using ASP?
Date Posted: 09 February 2005 at 6:09pm
Does anyone know of a good ASP solution for a random image rotator component - something very similar to the image rotator created by Dan Benjamin at a list apart : http://www.alistapart.com/articles/betterrotator/

(Dan Benjamin's solution is PHP based)

I'm looking for a solution that will allow me to have a group of images that are kept in a folder designated for a specific page that will call up one of those images randomly.

On top of that, I'm looking for a solution that will allow me to simply insert or remove an image from that folder without touching the source code that calls up the image.

Any ideas?

Subbu.



Replies:
Posted By: bootcom
Date Posted: 27 February 2005 at 10:35pm
Do it without using a component at all ... can I ask do you want it to call a random image everytime ??
 
If so, I can give you some code that will do this for you, just drop me a PM/ email and I will go through it with you.


Posted By: MadDog
Date Posted: 27 February 2005 at 11:18pm
IIS has a built in ad rotator component. Try doing a search on google, there are tons of tutorials.

-------------
http://www.iportalx.net" rel="nofollow">


Posted By: ub3rl337ch3ch
Date Posted: 28 February 2005 at 12:27am

you could use a random number gen, and simply use filenames for your images which include those numbers (ie img_1.gif, img_2.gif etc) then wherever you want the random image, just go:

images/img_<%=randomnumber%>.gif
 
obviously it requires all images to be the same file type, and it would require you to change the code whenever you changed the number of images in the folder and the above code undoubtedly use incorrect syntax, but you get my drift? whether thats just being overly creative for what might be a relatively simple problem i have no idea, but its a thought.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net