| Home | Advertisement Management Systems | KV's Kool ASP | |||||||||||||||||||||||||
|
AdRotator Component If you have more than one advertisement, and want to display all those advertisements on top of your page alternatively, you can use AdRotator component. AdRotator is an intrinsic component of ASP right from ASP version 1.0. This component delivers Advertisements based on information stored in a Text file. This component displays advertisements randomly based on specified percentage. Implementing an advertisement system using AdRotator component is an easy process. Let's use a sample to understand it very clearly. First you need to create a plain text file which stores all of your advertisements information. The first four lines of this file are optional, but it is better to mention these lines. This file is called as Rotator Schedule File. The following is Rotator Schedule file for our sample: <!-- Beginning of adRotator.txt file --> REDIRECT adRedir.asp <!-- End of adRotator.txt file --> The first four lines in the above text file are parameters for all the advertisements specified in the file. First line specifies a redirection file, that can be used to track number of clicks advertisement wise. If we specify a redirection file, whenever a user clicks on the advertisement, he/she will be redirected to the specified file along with the URL of the advertisement destination. So, we should again redirect the user to the advertisement destination using a redirection statement in the redirection file. The following is the redirection file used in our sample. <!-- Beginning of adRedir.asp file --> <% <!-- End of adRedir.asp file --> We will discuss how to track the clicks using this redirection file here. Second and third lines specifies width and height of the advertisement banner image size in pixels. Note that this size is going to be same of all advertisements specified in this text file. International standard size of banner advertisement is 468 X 60 pixels. Fourth line specifies the border size in pixels for the banner advertisement. After the fourth line, there is an asterik (*) symbol, which is mandatory in the text file, whether we specify the first four lines or not. Then actual advertisement information will start. For each advertisement, we have to specify: 1. The advertisement
banner image location (URL) Now let's look at the sample ASP file that implements the AdRotator component. <!-- Beginning of the adRotatorExample.asp --> <HTML> <p>Displaying Advertisements using AdRotator Component</p> <% ' Declare a variable called adRotator Dim adRotator ' Create an instance of adRotator component Set adRotator=Server.CreateObject("MSWC.AdRotator") ' Use the following line if you want to display the advertisement in a new window adRotator.TargetFrame = "target=_blank" ' Display an advertisement using AdRotator component based on information stored in adRotator.txt file Response.Write adRotator.GetAdvertisement("adRotator.txt") %> <p>Refresh this page to see another advertisement.</p> <p>Note: AdRotator
Component displays advertisements randomly, so you may get the same
advertisement second time. If so, refresh it again to see a new
advertisement.<p> <!-- End of the adRotatorExample.asp --> Click here to see this sample in action! Hope it is all clear! Mail your comments (and doubts) to pkvnm@yahoo.com
Back to: Advertisement Management Systems - Overview |
||||||||||||||||||||||||||
| Refer this site | ASPAlliance.com | Contact Us | Join | Advertise | Best Viewed with IE 4.0 or above | ||||||||||||||||||||||||||