AdRotator.KeywordFilter プロパティ

定義

XML 広告ファイル内の特定のタイプの広告をフィルター処理するためのカテゴリ キーワードを取得または設定します。

public:
 property System::String ^ KeywordFilter { System::String ^ get(); void set(System::String ^ value); };
[System.ComponentModel.Bindable(true)]
public string KeywordFilter { get; set; }
[<System.ComponentModel.Bindable(true)>]
member this.KeywordFilter : string with get, set
Public Property KeywordFilter As String

プロパティ値

XML 広告ファイル内の特定のタイプの広告をフィルター処理するためのキーワード。 既定値は空の文字列 ("") です。

属性

次のコード例では、 プロパティを使用 KeywordFilter してゲーム関連の広告をフィルター処理する方法を示します。

<%@ Page Language="C#" AutoEventWireup="True" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
 
 <head runat="server">
    <title>AdRotator Example</title>
</head>
 
 <body>
    <form id="form1" runat="server">
 
       <h3>AdRotator Example</h3>
 
       <asp:AdRotator id="AdRotator1" runat="server"
            Target="_self"
            KeywordFilter="Games"
            AdvertisementFile="~/App_Data/Ads.xml"/>
 
    </form>
 </body>
 
 </html>
<%@ Page Language="VB" AutoEventWireup="True" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
 
 <head runat="server">
    <title>AdRotator Example</title>
</head>
 
 <body>
    <form id="form1" runat="server">
 
       <h3>AdRotator Example</h3>
 
       <asp:AdRotator id="AdRotator1" runat="server"
            Target="_self"
            KeywordFilter="Games"
            AdvertisementFile="~/App_Data/Ads.xml"/>
 
    </form>
 </body>
 
 </html>

次のコード例では、XML アドバタイズ ファイル内の各アドバタイズにキーワードを指定する方法を示します。 ファイル形式の詳細については、 メンバーを AdvertisementFile 参照してください。

<Advertisements>  
  <Ad>  
    <ImageUrl>~/Images/image1.jpg</ImageUrl>  
    <Height>60</Height>  
    <Width>190</Width>  
    <NavigateUrl>http://www.microsoft.com</NavigateUrl>  
    <AlternateText>Microsoft Main Site</AlternateText>  
    <Impressions>80</Impressions>  
    <Keyword>Business</Keyword>  
    <Caption>This is the caption for Ad#1</Caption>   
  </Ad>  
  <Ad>  
    <ImageUrl>~/Images/image2.jpg</ImageUrl>  
    <Height>90</Height>  
    <Width>90</Width>  
    <NavigateUrl>http://www.wingtiptoys.com</NavigateUrl>  
    <AlternateText>Wingtip Toys</AlternateText>  
    <Impressions>80</Impressions>  
    <Keyword>Games</Keyword>  
    <Caption>This is the caption for Ad#2</Caption>   
  </Ad>  
</Advertisements>  

注釈

XML アドバタイズ ファイル内の各アドバタイズには、カテゴリ キーワードを割り当てることができます。 プロパティを KeywordFilter 使用して、指定したキーワードの提供情報をフィルター処理します。 コントロールには、 キーワードを含むアドバタイズのみが選択 AdRotator されます。 プロパティは、ユーザーの KeywordFilter プロファイルと一致するようにプログラムで設定できます。

プロパティは KeywordFilter 、指定したキーワードを検索する非常に単純なフィルターです。 プロパティに複数のキーワードを KeywordFilter 指定することも、アドバタイズ ファイルで複数のキーワードを宣言することもできません。

注意

AdvertisementFileこのプロパティを有効にするには、 プロパティを設定する必要があります。

注意事項

指定したキーワードが XML アドバタイズ ファイルに見つからない場合、コントロールに AdRotator アドバタイズは表示されません。 このプロパティのキーワードを指定し、アドバタイズ ファイルに少なくとも 1 つの一致を指定してください。

適用対象

こちらもご覧ください