ASP AdRotator Component Instance Tutorial

Source: Internet
Author: User

OK, let's look at the ASP AdRotator component Instance Tutorial.

The ASP AdRotator component creates a AdRotator object that displays a different picture each time the user enters or collates the page. A text file contains related pictures.

Grammar

<%
Set Adrotator=server.createobject ("MSWC. AdRotator ")
AdRotator. GetAdvertisement ("Textfile.txt")
%>

For example
Suppose we have a file named "Banners.asp". It looks like this:

<body>
<%
Set Adrotator=server.createobject ("MSWC. AdRotator ")
Response.Write (AdRotator. GetAdvertisement ("Ads.txt"))
%>
</body>

The file "Ads.txt" looks like this:

*
W3schools.gif
http://www.111cn.net/
Visit W3Schools
80
Microsoft.gif
http://www.111cn.net/
Visit Microsoft
20

The line below the asterisk file "Ads.txt" Specifies the image shown, hyperlink address, alternative text (for images), and displays at the rate of the hit. We see that the http://www.111cn.net/image will display 80 hits and the Microsoft image will be displayed as 20 of the hits on the text file.

Note: To get a contact job when the user clicks on them, we will have to modify the file "Ads.txt" somewhat:

REDIRECT banners.asp
*
W3schools.gif
http://www.w3schools.com/
Visit W3Schools
80
Microsoft.gif
http://www.microsoft.com/
Visit Microsoft
20

The redirect page (banners.asp) now receives a query string variable named after the URL that contains the URL redirect to.

Note: To specify the height, width, and image of the border, you can insert the following line redirection:
REDIRECT banners.asp
WIDTH 468
HEIGHT 60
BORDER 0
*
111cn.gif
...
...


The thing in the past is to add some code lines to the "banners.asp" file:
<%
url=request.querystring ("url")
If url<> "" then Response.Redirect (URL)
%>

<body>
<%
Set Adrotator=server.createobject ("MSWC. AdRotator ")
Response.Write (AdRotator. GetAdvertisement ("Textfile.txt"))
%>
</body>

Okay, let's look at the ASP AdRotator methods and properties.

For example, property description
Border designated size, the border around the advertisement "%
Set Adrot = Server.CreateObject ("MSWC.") AdRotator ")
Adrot. Border = "2"
Response.Write (Adrot. GetAdvertisement ("Ads.txt"))
% “
Click on whether the specified advertisement is a hyperlink "%
Set Adrot = Server.CreateObject ("MSWC.") AdRotator ")
Adrot. clickable = False
Response.Write (Adrot. GetAdvertisement ("Ads.txt"))
% “
TargetFrame Name box to display AD "%
Set Adrot = Server.CreateObject ("MSWC.") AdRotator ")
Adrot. TargetFrame = "target = ' _blank '"
Response.Write (Adrot. GetAdvertisement ("Ads.txt"))
% “

Method
such as Description method
GetAdvertisement return HTML Display ads on page <%
Set Adrot = Server.CreateObject ("MSWC.") AdRotator ")
Response.Write (Adrot. GetAdvertisement ("Ads.txt"))
% “

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.