Ad Rotator in ASP

Submitted by Karthikeyan on Sun, 19/08/2012 - 18:38

AdRotator component in asp is used to display different ad images in random manner.
File 1: adrotator.asp


<%
url=Request.QueryString("url")
If url<>"" then Response.Redirect(url)
%>


<%
set adrot=Server.CreateObject("MSWC.AdRotator")
%>
Ad Rotator Component 
<% response.write(adrot.GetAdvertisement("adtextfile.txt")) %>
In a new window
<% adrot.TargetFrame="target='_blank'" Response.Write(adrot.GetAdvertisement("adtextfile.txt")) %>
Without Clicking
<% adrot.Clickable=false Response.Write(adrot.GetAdvertisement("adtextfile.txt")) %>

File 2 : adtextfile.txt


REDIRECT adrotator.asp
*
adimage1.gif
livetolearn.in
Live to Learn Web
50
adimage2.gif
livetolearn.in/programming/asp
ASP Programs at LivetoLearn
50 

File 3 & 4 : Ad Images
Keep two images as in the name below of your choice in the same folder.
adimage1.gif
adimage2.gif