PDA

View Full Version : ASP - Display random images



MattM
03-22-2004, 03:26 PM
I have some images and I would like to randomly display them on a page using ASP? How would I do this?

GCT13
03-22-2004, 03:47 PM
<%

' *** Randomize 4 images ***

Dim intRand
Randomize
intRand = int(4*Rnd()+1) ' *** notice the 4 ***
Select Case intRand
Case 1
Response.Write "<img src=""/images/1.jpg"" />"
Case 2
Response.Write "<img src=""/images/2.jpg"" />"
Case 3
Response.Write "<img src=""/images/3.jpg"" />"
Case 4
Response.Write "<img src=""/images/4.jpg"" />"
End Select

%>