codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:



Home » ASP » Article

Banner Ad Rotator

Article by: Art Downey (3/20/2003)
Bookmark us now! Add to Favourites
Email a friend!Tell a friend
Sponsored by: FindMyHosting - Web Hosting Search
Summary: An introduction to the Microsoft AdRotator component which ships with IIS and is the simplest way to implement banner ad rotation on your site.
Viewed: 20874 times Rating (38 votes): 
 4.5 out of 5
 Rate this Article  Read Comments  Post Comments

Banner Ad Rotator



The default installation of IIS comes with a Microsoft banner ad component called AdRotator. To use the component, the first thing we need to do is create a text file in the following format:

Select All Code


We'll call this file banner_ads.txt

Now let's take this apart. The redirect line we'll come to in a moment. The next three lines are the width, height and border of the ad - all obvious enough. Next, a compulsary star. Then follow image path, link , alt text and percentage shown for the first banner, followed by the same for the next banner. This text file would therefore show 80% CodeToad banners, and 20% Google. You can have as many banners as you like.

Now back to the redirect line. You'll notice the page name ads.asp. This is a name I made up and it can be any asp page you create. This page will now receive a querystring with a variable named URL containing the URL to redirect to.

If that's all we want to do we would simply add the following code to the ads.asp page:

Select All Code


But this would be the place to monitor click throughs and statistics should you wish to do so, perhaps by storing the url in a database.

Calling the ads

So that's the system set up, now all we need to do is call the banner from our page. That's just like calling any other component:

Select All Code


The MSWC.AdRotator object is created, and goes to the banner_ads.txt file to read off the details of the ads, and display one, according to the percentages. It's as easy as that.





CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
Rate this article:     Poor Excellent
View highlighted Comments
User Comments on 'Banner Ad Rotator'
Posted by :  Archive Import (Ray Middleton) at 14:32 on Friday, May 30, 2003
hiya

ive followed the code exactly and all works fine, except for the url for the mouse over and execution of link.

i end up gettin url's like:

http://www.renaultsportsclub.co.uk/ads.asp?url=http://www.fastandfuriousshow.co.uk/&image=../mainimages/f_f_banner2211.gif

instead of just http://www.fastandfuriousshow.co.uk

could u please guide me as to what i am doin wrong.

many thanks

Ray
Posted by :  Archive Import (jake) at 10:45 on Monday, June 09, 2003
I am having exactly the same problem as the poster above.
When clicking the image it doesnt work as expected.
Posted by :  Archive Import (dholder) at 15:04 on Monday, September 15, 2003
make sure your redirect file is uploaded and its linked in the schedule file.
Posted by :  MSpoon at 20:33 on Thursday, October 23, 2003
Hi all,

Are there any tutorials out there that show how to actually track impressions and clicks on the ads that are served with this component.

I have the component working fine, but I want to be able to check how many times an ad has been served and clicked on.

Thanks for any ideas.

MSpoon
Posted by :  bintababe at 12:00 on Tuesday, October 23, 2007
Hello my dear
compliment of the day.
my name is Binta,i am happy to contact you with all my heart,sorry to hear that a girl like me is searching for love,but i believe and i think that we can make it together,please i will like you to email me back if you real interested in my love, I believe we can move from here. I will be waiting to receive your lovely reply soonest,where i can give you my picture for you to know whom i am please contact back also with love from your heart,
thanks with love from my heart.
Binta


To post comments you need to become a member. If you are already a member, please log in .

 



RELATED ARTICLES
ASP Format Date and Time Script
by Jeff Anderson
An ASP script showing the variety of date and time formats possible using the FormatDateTime Function.
ASP FilesystemObject
by Jeff Anderson
An introduction to the Filesystemobject
Email validation using Regular Expression
by Jeff Anderson
Using regular expression syntax is an exellent way to thoroughly validate an email. It's possible in ASP.
Creating a Dynamic Reports using ASP and Excel
by Jeff Anderson
A simple way to generate Excel reports from a database using Excel.
Create an ASP SQL Stored Procedure
by Jeff Anderson
A beginners guide to setting up a stored procedure in SQL server and calling it from an ASP page.
Creating an SQL Trigger
by Jeff Anderson
A beginners guide to creating a Trigger in SQL Server
ASP Shopping Cart
by CodeToad Plus!
Complete source code and demo database(Access, though SQL compatible) to an ASP database driven e-commerce shopping basket, taking the user through from product selection to checkout. Available to CodeToad Plus! Members
Concatenate strings in sql
by Jeff Anderson
A brief introduction to concatenating strings in an sql query (using SQL server or access databases).
ASP OpenTextFile
by Jeff Anderson
An introduction to the OpenTextFile Method of the FileSystemObject
The asp:checkbox and asp:checkboxlist control
by David Sussman, et al
Checkboxes are similar to radio buttons, and in HTML, they were used to allow multiple choices from a group of buttons.








Recent Forum Threads
• hidden div block when displayed, displays at an offset of 200px only in IE 6..
• help - sketch
• Re: Perl Script - File Handling.
• Open a file from website
• Re: to open 5 terminals from one and also execute different commands on each terminal
• read a selected multiple line, those should match some of the values read in the files..
• Help me please
• Empty the contents of a file.
• Month Start, End dates


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2008