ASP AdRotator
ASP AdRotator component
Whenever a user enters a website or refresh the page, ASP AdRotator component creates an AdRotator object to display a different image. Information about the image is contained in a text file.
Note: AdRotator does not work Internet Information Server 7 (IIS7) in.
grammar
set adrotator=server.createobject("MSWC.AdRotator")
adrotator.GetAdvertisement("textfile.txt")
%>
ASP AdRotator examples
Suppose we have a file called "ads.txt", as follows:
*
w3s.gif
http://www.w3cschool.cc
Free Tutorials from W3CSchool
50
xmlspy.gif
http://www.altova.com
XML Editor from Altova
50
In the above text file, type the following line specifies the name of the image replacement text to be displayed, the hyperlink addresses, images and every hundred clicks the display probability.
The first line of the above text file is specified when the action performed when visitors click on the image. Redirect page (banners.asp) will receive a query string with the redirect URL.
Tip: To specify the image height, width, and border, you can insert the following code REDIRECT following:
WIDTH 468
HEIGHT 60
BORDER 0
*
w3s.gif
...
"Banners.asp" file as follows:
Examples
url=Request.QueryString("url")
If url<>"" then Response.Redirect(url)
%>
<!DOCTYPE html>
<html>
<body>
<%
set adrotator=Server.CreateObject("MSWC.AdRotator")
response.write(adrotator.GetAdvertisement("textfile.txt"))
%>
</body>
</html>
The demonstration >>
Well, that is all the content!
ASP AdRotator Properties
属性 | 描述 | 实例 |
---|---|---|
Border | 规定围绕广告的边框的尺寸。 | <% set adrot=Server.CreateObject("MSWC.AdRotator") adrot.Border="2" Response.Write(adrot.GetAdvertisement("ads.txt")) %> |
Clickable | 规定广告本身是否是超链接。 | <% set adrot=Server.CreateObject("MSWC.AdRotator") adrot.Clickable=false Response.Write(adrot.GetAdvertisement("ads.txt")) %> |
TargetFrame | 显示广告的框架名称。 | <% set adrot=Server.CreateObject("MSWC.AdRotator") adrot.TargetFrame="target='_blank'" Response.Write(adrot.GetAdvertisement("ads.txt")) %> |
ASP AdRotator Methods
方法 | 描述 | 实例 |
---|---|---|
GetAdvertisement | 返回在页面中显示广告的 HTML。 | <% set adrot=Server.CreateObject("MSWC.AdRotator") Response.Write(adrot.GetAdvertisement("ads.txt")) %> |