次の方法で共有


AdRotator.Target プロパティ

AdRotator コントロールがクリックされたときのリンク先 Web ページの内容を表示するブラウザのウィンドウまたはフレームの名前を取得または設定します。

Public Property Target As String
[C#]
public string Target {get; set;}
[C++]
public: __property String* get_Target();public: __property void set_Target(String*);
[JScript]
public function get Target() : String;public function set Target(String);

プロパティ値

AdRotator コントロールがクリックされたときのリンク先 Web ページの内容を表示するブラウザのウィンドウまたはフレーム。既定値は String.Empty です。

解説

Target プロパティを使用して、 AdRotator コントロールがクリックされたときのリンク先 Web ページの内容を表示するウィンドウまたはフレームを指定します。アンダースコア (_) から始まる次の特殊な値を除き、値は a から z の範囲の文字 (大文字小文字を区別しない) で始まる必要があります。

_blank フレームなしの新しいウィンドウに内容を表示します。
_parent フレームセットの親に内容を表示します。
_self フォーカスのあるフレームに内容を表示します。
_top 最大化されたフレームなしのウィンドウに内容を表示します。

使用例

[Visual Basic, C#, JScript] Target プロパティを使用する方法を次の例に示します。この例では、 AdRotator コントロールがクリックされたときのリンク先 Web ページの内容を新しいフレームなしのウィンドウに表示します。

 
<%@ Page Language="VB" AutoEventWireup="True" %>
<html>
 
 <head>
 </head>
 
 <body>
    <form runat="server">
 
       <h3>AdRotator Example</h3>
 
       <asp:AdRotator id="AdRotator1" runat="server"
            Target="_self"
            AdvertisementFile="Ads.xml"/>
 
    </form>
 </body>
 
 </html>

[C#] 
<%@ Page Language="C#" AutoEventWireup="True" %>
<html>
 
 <head>
 </head>
 
 <body>
    <form runat="server">
 
       <h3>AdRotator Example</h3>
 
       <asp:AdRotator id="AdRotator1" runat="server"
            Target="_self"
            AdvertisementFile="Ads.xml"/>
 
    </form>
 </body>
 
 </html>

[JScript] 
<%@ Page Language="JScript" AutoEventWireup="True" %>
<html>
 
 <head>
 </head>
 
 <body>
    <form runat="server">
 
       <h3>AdRotator Example</h3>
 
       <asp:AdRotator id="AdRotator1" runat="server"
            Target="_self"
            AdvertisementFile="Ads.xml"/>
 
    </form>
 </body>
 
 </html>

[Visual Basic, C#, JScript] 広告情報を含む XML ファイルのファイル形式を次の例に示します。ファイル形式の詳細については、 AdvertisementFile メンバのトピックを参照してください。

<Advertisements>
 
 <Ad>
 <ImageUrl>image1.jpg</ImageUrl>
 <href>https://www.microsoft.com</href>
 <AlternateText>Microsoft Main Site</AlternateText>
 <Impressions>80</Impressions>
 <Keyword>Topic1</Keyword>
 <Caption>This is the caption for Ad#1</Caption> 
 </Ad>
 
 <Ad>
 <ImageUrl>image2.jpg</ImageUrl>
 <href>http://www.wingtiptoys.com</href>
 <AlternateText>Wing Tip Toys</AlternateText>
 <Impressions>80</Impressions>
 <Keyword>Topic2</Keyword>
 <Caption>This is the caption for Ad#2</Caption> 
 </Ad>
 
</Advertisements>

[C++] C++ のサンプルはありません。Visual Basic、C#、および JScript のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 2000, Windows XP Professional, Windows Server 2003 ファミリ

参照

AdRotator クラス | AdRotator メンバ | System.Web.UI.WebControls 名前空間 | AdvertisementFile