【 tulaoshi.com - ASP 】
By Wayne Berry
This Issue
Many sites that are content specific depend on banner advertisement for revenue. Such is the case for 15
Seconds. A banner is displayed at the top of the page for every page viewed. Clients usually buy a set
number of banner impressions and these impressions are rotated amongst all the clients over a period of
time. In order to do this there must be a dynamic quality to the banners. In other words, the banner to
display is not determined until that page is requested.
With an Active Server page this is an easy task. Active Server Pages are dynamic and there are many
components that handle the task of banner rotation. A simple one comes free with the Internet Information
Server, and more complicated rotation schedules can be done with Site Server and other third party
components. This article is not about how to implement these components within your Active Server pages,
since this is a fairly easy task.
This article will describe how to implement a banner rotation scenario where the pages served are static,
i.e. .htm, and do not have the flexibility to call components. The task is to dynamically serve banners
and statically serve pages. This is the opposite of the scenario for banner rotation components, which
statically serve banners and dynamically serve pages.
One Trick
There is only one trick here and once you know it the rest is pretty straightforward. Internet Explorer
and Netscape allow you to refer to an Active Server Page within an image tag. Example 1 demonstrates the
HTML to be inserted in the static page.
Example 1 : HTML Banner Reference
< IMG src="http://img.jcwcn.com/attachment/portal"