WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

ASP AdRotator Component


ASP AdRotator Component

The ASP AdRotator part makes an AdRotator object that shows an alternate picture each time a client enters or invigorates a page. A content document incorporates data about the images.

Note: The AdRotator does not work with Internet Information Server 7 (IIS7).

Syntax

<%
set adrotator=server.createobject("MSWC.AdRotator")
adrotator.GetAdvertisement("textfile.txt")
%>

ASP AdRotator Example

Assume that we have the accompanying content document, named "ads.txt":

Divert banners.asp
*
w3s.gif
http://www.welookups.com
Free Tutorials from welookups
50
xmlspy.gif
http://www.altova.com
XML Editor from Altova
50

The lines underneath the mark in the content record above determines the name of the pictures (promotions) to be shown, the hyperlink addresses, the substitute content (for the pictures), and the presentation rates (in percent).

The first line in the content record above determines what to happen when a guest taps on one of the pictures. The redirection page (banners.asp) will get a querystring with the URL to divert to.

Tip: To determine the stature, width, and outskirt of the picture, you can embed the accompanying lines under REDIRECT:

Divert banners.asp
WIDTH 468
Tallness 60
Outskirt 0
*
w3s.gif
...

The "banners.asp" document looks like this:

Example

<%
url=Request.QueryString("url")
In the event that url<>"" at that point Response.Redirect(url)
%>

<!DOCTYPE html>
<html>
<body>
<%
set adrotator=Server.CreateObject("MSWC.AdRotator")
response.write(adrotator.GetAdvertisement("textfile.txt"))
%>
</body>
</html>

That's all!!


ASP AdRotator Properties

Property Description Example
Border Specifies the extent of the fringes around the advertisement <%
set adrot=Server.CreateObject("MSWC.AdRotator")
adrot.Border="2"
Response.Write(adrot.GetAdvertisement("ads.txt"))
%>
Clickable Specifies whether the promotion is a hyperlink <%
set adrot=Server.CreateObject("MSWC.AdRotator")
adrot.Clickable=false
Response.Write(adrot.GetAdvertisement("ads.txt"))
%>
TargetFrame Name of the edge to show the advertisement <%
set adrot=Server.CreateObject("MSWC.AdRotator")
adrot.TargetFrame="target='_blank'"
Response.Write(adrot.GetAdvertisement("ads.txt"))
%>

ASP AdRotator Methods

Method Description Example
GetAdvertisement Returns HTML that shows the notice in the page <%
set adrot=Server.CreateObject("MSWC.AdRotator")
Response.Write(adrot.GetAdvertisement("ads.txt"))
%>