Skip to main content
Home
Live to Learn!

Main navigation

  • Home
  • Learn
    • FoxPro
    • MS-DOS
    • C PRG
    • Java
    • ASP
    • Ruby on Rails
    • ASP.NET
    • E-Books
    • Exam Preparation
    • Tools
  • Blog
  • Forums
  • Contact
User account menu
  • Log in

Breadcrumb

  1. Home
  2. ASP Programs

Ad Rotator in ASP

Book navigation

  • Displaying a message according to the time of a day and weekday.
  • Cookies Manipulation
  • Ad Rotator in ASP
  • Example Forms - Course Registration
  • Select, Insert, Update, Delete Records in Database - Employee
  • Login form with Timeout
By Karthikeyan , 19 August, 2012

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

  • Add new comment

Comments

Featured Blog Posts

Convert Currency in Number to Words (Indian Rupees) - MS Excel
Foxpro Tutorial and Programs
Convert Currency in Number to Words in MS Word
Convert Currency in Number to Words (Indian Rupees) - Version 2
Best way to Use Rupee Symbol in Windows – Easy steps
Convert Currency in Number to Words - MS Access
Creating All in One Windows XP DVD with all Important Applications
RSS feed

© 2009-2025 Live to Learn.In

Terms of Use | Privacy Policy