| Home | Advertisement Management Systems | KV's Kool ASP | |||||||||||||||||||||||||
|
A Simple Alternative to AdRotator Component Now you are creating your own advertisement system without using AdRotator component. It's very easy to buildup and extend it to a more complex system. First you need to create the following asp file that contains the advertisement processing logic. <!-- Beginning of adServe.asp file --> <% PUBLIC FUNCTION showAd() ' The following line specifies how many
advertisements do you have. ' The following lines are to Initialize
random-number generator and to produce a random number based on the value of
totalAds variable. SELECT CASE adCode CASE 1
url = "http://www.aspalliance.com" CASE 2
url = "http://www.telugupeople.com" CASE 3
url = "http://www.bbcworld.com" END SELECT showAd = "<a href='" &
url & _ END FUNCTION %> <!-- End of adServe.asp file --> Your advertisement system is ready. Just call it into your page. Following code shows how to display an advertisement using the above advertisement system. <!-- Beginning of adServeRun.asp file --> <!-- #include file ="adServe.asp"--> <%=adCode%> <!-- End of adServeRun.asp file --> That's it! See this example working live! It displays advertisements in random order. You may change this logic. Also, this displays the advertisement directly. You can use a redirection page to store click-through information. See here to find how to use a redirection page. Change the last line in adServe.asp file shown above as follows, if you want to use a redirection page: showAd = "<a href='adRedir.asp?url=" & _ If you want to open the advertisement in a new window, Change the last line in adServe.asp file shown above as follows: showAd
= "<a href='" & url & _ See here to find how to extend this simple system using a database. Back to: Advertisement Management Systems - Overview |
||||||||||||||||||||||||||
| Refer this site | ASPAlliance.com | Contact Us | Join | Advertise | Best Viewed with IE 4.0 or above | ||||||||||||||||||||||||||