ASP AdRotator Bileşeni
ASP AdRotator Bileşeni
ASP AdRotator bileşeni, bir kullanıcı bir sayfaya her girdiğinde veya sayfayı her yenilediğinde farklı bir görüntü görüntüleyen bir AdRotator nesnesi oluşturur. Bir metin dosyası, resimlerle ilgili bilgileri içerir.
Not: AdRotator, Internet Information Server 7 (IIS7) ile çalışmaz.
Sözdizimi
<%
set adrotator=server.createobject("MSWC.AdRotator")
adrotator.GetAdvertisement("textfile.txt")
%>
ASP AdRotator Örneği
"ads.txt" adlı aşağıdaki metin dosyasına sahip olduğumuzu varsayalım:
REDIRECT banners.asp
*
w3s.gif
https://www.w3schools.com
Free Tutorials from W3Schools
50
xmlspy.gif
https://www.altova.com
XML Editor from Altova
50
Yukarıdaki metin dosyasında yıldız işaretinin altındaki satırlar, görüntülenecek resimlerin (reklamların) adını, köprü adreslerini, alternatif metni (resimler için) ve görüntüleme oranlarını (yüzde olarak) belirtir.
Yukarıdaki metin dosyasındaki ilk satır, bir ziyaretçi resimlerden birine tıkladığında ne olacağını belirtir. Yeniden yönlendirme sayfası (banners.asp), yönlendirilecek URL'yi içeren bir sorgu dizesi alacaktır.
İpucu: Resmin yüksekliğini, genişliğini ve kenarlığını belirtmek için YÖNLENDİRME altına aşağıdaki satırları ekleyebilirsiniz:
REDIRECT banners.asp
WIDTH 468
HEIGHT 60
BORDER 0
*
w3s.gif
...
"banners.asp" dosyası şöyle görünür:
Örnek
<%
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>
Bu kadar!!
ASP AdRotator Özellikleri
Property | Description | Example |
---|---|---|
Border | Specifies the size of the borders around the advertisement | <% set adrot=Server.CreateObject("MSWC.AdRotator") adrot.Border="2" Response.Write(adrot.GetAdvertisement("ads.txt")) %> |
Clickable | Specifies whether the advertisement is a hyperlink | <% set adrot=Server.CreateObject("MSWC.AdRotator") adrot.Clickable=false Response.Write(adrot.GetAdvertisement("ads.txt")) %> |
TargetFrame | Name of the frame to display the advertisement | <% set adrot=Server.CreateObject("MSWC.AdRotator") adrot.TargetFrame="target='_blank'" Response.Write(adrot.GetAdvertisement("ads.txt")) %> |
ASP AdRotator Yöntemleri
Method | Description | Example |
---|---|---|
GetAdvertisement | Returns HTML that displays the advertisement in the page | <% set adrot=Server.CreateObject("MSWC.AdRotator") Response.Write(adrot.GetAdvertisement("ads.txt")) %> |