ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 5th, 2003, 10:58 AM
AliCat AliCat is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Green Bay, Wisconsin
Posts: 60 AliCat User rank is Private First Class (20 - 50 Reputation Level)AliCat User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 5 h 43 m 32 sec
Reputation Power: 6
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))
%>

Reply With Quote
  #2  
Old September 5th, 2003, 11:55 AM
Vlince Vlince is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Canada, Quebec, Montreal
Posts: 410 Vlince User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Randomizing images


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway