Banner Ad Rotator

If you want to rotate banner ads on your web page, you are in luck.  You can use this simple and straight forward Ad Rotator component, which comes standard with ASP.

To do this, create a text file called /AdRotator.txt and copy the code below:

REDIRECT /anyfile.asp
Visit Advertiser1 now!
Visit Advertiser2 now!
Visit Advertiser3 now!
Visit Advertiser4 now!

This schedule has four banner ads in it.  The top four lines are optional, but the * is required.  The Redirect sends all banner ad clicks to a specified ASP file, you can use this option if you want to track banner ad statistics.  The Width and Height set the dimensions of the banner ad, and the Border sets the border thickness around the banner ad.

After the *, you can list as many banners as you want.  Each banner that you list, consists of four lines:  1) URL of banner ad image;  2) URL users will be sent to when they click on the banner ad;  3) the image ALT text; and  4) the percentage of time that you want the banner to display on the page (must total 100).

Next, paste the following code to any of your ASP pages where you want to display your banner ads:

DIM strBanners
Set strBanners = Server.CreateObject("MSWC.AdRotator")
Response.Write (strBanners.GetAdvertisement("/adrotator.txt"))

That’s it, you have a professional looking banner ad rotation system.  Now, it’s up to you to go out and find some advertisers!

< Back to ASP Scripts