Solved

Classic ASP Sequential Image Rotator with 8 seconds time delay

Posted on 2010-08-23
2
505 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
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 is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

895 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now