|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Randomizing images
I'm trying to have my program randomly select one of five images. I think my syntax is correct (that is it isn't giving my any error messages and the page loads with the image being replaced by a broken link 'X' box), but I don't know how to display the image to the screen.
Should the response.redirect part automatically display it to the screen or should I have it in some tag like <td><img scr ="lrandom"></td> within my table??? Thanks in advance for any help! -------------------------------------------------------- <% dim array(5) randomize array(1)="img1.gif" array(2)="img2.gif" array(3)="img3.gif" array(4)="img4.gif" array(5)="img5.gif" upperbound=ubound(array) lowerbound=0 lrandom = Int((upperbound - lowerbound + 1) * rnd + lowerbound) response.redirect "images/" & (Array(lrandom)) %> |
|
#2
|
|||
|
|||
|
The definition of the Response.Redirect method is:
The Redirect method can be used to redirect the **client browser** from the current page to a different page Also, to display an image on/in the browser, you need to use the <img> tag...this is basic HTML! Now, instead of making a Response.Redirect why not try this: Response.Write "<img src=""images/" & Array(lrandom) & """>" You'll need to add the width= and height= and all the other attributes of the <img> tag...if that's what you want of course! Hope this helps! Sincerely Vlince |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Randomizing images |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|