Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

automatic refresh ads by using ASP ad rotator

Status
Not open for further replies.

royyan

Programmer
Jul 18, 2001
148
US
I am trying to use ASP ad rotator(MSWC.AdRotator) in displaying ads on my web site. This component only allow me to refresh ads when the page reloads. What I want is to refreshing ads every 20 seconds without reloading the whole page.
Any good suggestions? Thanks!
 
Because it's a server component, in order to use rotator you will need to refresh the page every 20 seconds, which can be done with HTML meta tag but it will end up being heavy load on your IIS server.

Better to use something client side like Javascipt, Flash.
 
Thanks!
I used refresh in meta tag. The banner works fine. But, like you said, it refreshes every 20 seconds makes page looks anoying.
Do you have any good suggesstions if I want to use Java Script?
Many thanks!
 
you could always iframe your banners, then those can refresh independantly

or you could javascript something of the likes ( you'll need a ASP page to image stream, pretty common ) :

Code:
<img src="ads.asp" name="ads1" id="ads1">
<script>
function refreshAd(adId)
{
  document.getElementById(adId).src = "ads.asp";
  setTimeOut(refreshAds(adId),20000);
}
setTimeOut(refreshAds("ads1"),20000);
</script>
 
Thank you DreXor!

The iframe method looks like still cause some trouble on refreshing. Each time the iframe refreshes, it brings up the whole page on top. If I minimize the browser, the minimized tab will flash.

So I am trying the javascript method. I have a question:
What should be the format of image stream in ASP page?

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top