Solved

Classic ASP Sequential Image Rotator with 8 seconds time delay

Posted on 2010-08-23
2
509 Views
Last Modified: 2012-05-10
Hi all,

I need a classic ASP (not ASP.net) Image rotator that rotates sequentially not randomly(it's actually a .jpg banner rotator). Also, it needs to change every 8 seconds, not on the refresh of the page. Please, use the code below and modify it since this is the code my friend already has. One last thing, please no Javascript.

Thanks very much in advance,
Guzz

<%
' select 1 ad to show
randomize
random_number=int(rnd*3)+1

If random_number = 1 Then
Response.Write("<a href=""http://cs5launch.adobe.com/"" target=""_blank"" style=""float: right;""><img src=""images/cs5English728x90.jpg"" width=""728"" height=""90""></a>")
elseif random_number = 2 Then
Response.Write("<a href=""http://www.macpapers.com/"" target=""_blank"" style=""float: right;""><img src=""images/mac_conservation_4.jpg"" width=""728"" height=""90""></a>")
else
Response.Write("<a href=""http://www.saphiraconsumables.com/"" target=""_blank"" style=""float: right;""><img src=""images/728x90_Saphira.jpg"" width=""728"" height=""90""></a>")
End If
%>
0
Comment
Question by:guzz1
2 Comments
 
LVL 11

Accepted Solution

by:
madgino earned 250 total points
ID: 33508338
Asp code is running on the server. From the server you can't control the client (page in browser) as the client is the one that it initiates requests and the server is just responding.
You need to refresh page/picture on the client at every 8 seconds, you can't so this from asp as this code is on the server, you need to run some code on the client to do this.
And for running code on the client you have a different language called javascript.

So using javascript is the only possible solution, here are some straightforward links: Link1, Link2

If you really can't use Javascript because of technical restrictions you must add a meta tag to automatically refresh the page at 8 seconds and to handle this in asp. Also if you don't want to reload the whole page you'll have to use a frame or a iframe for the pictures section and to add some parameters to keep track of the pictures. Anyway this is a very complicated solution and I do not recommend it.
0
 
LVL 28

Expert Comment

by:sybe
ID: 33508779
No javascript? You could use an iframe with a refresh metatag.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question