AdCreatedEventArgsとは? わかりやすく解説

AdCreatedEventArgs クラス

AdRotator コントロールの AdCreated イベントデータ提供します。このクラス継承できません。

名前空間: System.Web.UI.WebControls
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public Class AdCreatedEventArgs
    Inherits EventArgs
Dim instance As AdCreatedEventArgs
public class AdCreatedEventArgs : EventArgs
public ref class AdCreatedEventArgs : public
 EventArgs
public class AdCreatedEventArgs extends EventArgs
public class AdCreatedEventArgs extends
 EventArgs
解説解説
使用例使用例

AdCreated イベントハンドラ指定およびコーディングする方法次のコード例示します。この例では AdRotator コントロール作成されたときに広告関連付けられた URL取得して次にその URL表示します。この例では、例の中でリストされている XML ファイル (Ads.xml) が必要です。

<%@ Page Language="VB" AutoEventWireup="True"
 %>

<html>
 <head>
 
 </head>
 
    <script language="VB" runat="server">
       Sub AdCreated_Event(sender As Object,
 e As AdCreatedEventArgs) 
          Message.Text=e.NavigateUrl
       End Sub
    </script>
 
 <body>
 
    <form runat="server">
 
       <h3>AdRotator Example</h3>
 
       <asp:AdRotator id="test1" runat="server"
            AdvertisementFile = "~/App_Data/Ads.xml"
            Borderwidth="1"
            Target="_blank"
            OnAdCreated="AdCreated_Event"/><br><br>
 
       <asp:label id="Message" runat="server"/>
 
    </form>
 
 </body>
 </html>
    
<%@ Page Language="C#" AutoEventWireup="True" %>

<html>
 <head>
 
 </head>
 
    <script language="C#" runat="server">
       void AdCreated_Event(Object sender, AdCreatedEventArgs
 e) 
       {
          Message.Text=e.NavigateUrl;   
       }      
    </script>
 
 <body>
 
    <form runat="server">
 
       <h3>AdRotator Example</h3>
 
       <asp:AdRotator id="test1" runat="server"
            AdvertisementFile = "~/App_Data/Ads.xml"
            Borderwidth="1"
            Target="_blank"
            OnAdCreated="AdCreated_Event"/><br><br>
 
       <asp:label id="Message" runat="server"/>
 
    </form>
 
 </body>
 </html>
    
<%@ Page Language="JScript" AutoEventWireup="True" %>

<html>
 <head>
 
 </head>
 
    <script language="JScript" runat="server">
       function AdCreated_Event(sender, e : AdCreatedEventArgs)
 
       {
          Message.Text=e.NavigateUrl;   
       }      
    </script>
 
 <body>
 
    <form runat="server">
 
       <h3>AdRotator Example</h3>
 
       <asp:AdRotator id="test1" runat="server"
            AdvertisementFile = "~/App_Data/Ads.xml"
            Borderwidth="1"
            Target="_blank"
            OnAdCreated="AdCreated_Event"/><br><br>
 
       <asp:label id="Message" runat="server"/>
 
    </form>
 
 </body>
 </html>
    

広告情報を含む XML ファイル書式設定する方法次のコード例示しますXML ファイル詳細については、AdRotator クラスの AdvertisementFile プロパティトピック参照してください

 <Advertisements>
  <Ad>
  <ImageUrl>image1.jpg</ImageUrl>
  <NavigateUrl>http://www.microsoft.com</NavigateUrl>
  <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>
  <NavigateUrl>http://www.wingtiptoys.com</NavigateUrl>
  <AlternateText>Wingtip Toys</AlternateText>
  <Impressions>80</Impressions>
  <Keyword>Topic2</Keyword>
  <Caption>This is the caption for Ad#2</Caption> 
  </Ad>
 </Advertisements>
<%@ Page Language="VB" AutoEventWireup="True"
 %>

<html>
<head>
 
</head>
 
   <script runat="server">

      Sub Page_Load(sender As Object,
 e As EventArgs)

         ' Create an EventHandler delegate for the method you want to
 handle the event
         ' and then add it to the list of methods called when the event
 is raised.
         AddHandler Ad.AdCreated, AddressOf
 AdCreated_Event

      End Sub

      Sub AdCreated_Event(sender As Object,
 e As AdCreatedEventArgs) 

         ' Override the AlternateText value from the ads.xml file.
         e.AlternateText = "Visit this site!"   

      End Sub      

   </script>
 
<body>
 
   <form runat="server">
 
      <h3>AdRotator AdCreated Example</h3>

      Notice that the AlternateText property of
 the advertisement <br>
      has been programmatically modified from the value in the
 XML <br>
      file. 

      <br><br>
 
      <asp:AdRotator id="Ad" runat="server"
           AdvertisementFile = "~/App_Data/Ads.xml"
           Borderwidth="1"
           Target="_blank"/>
 
   </form>
 
</body>
</html>

<%@ Page Language="C#" AutoEventWireup="True" %>

<html>
<head>
 
</head>
 
   <script runat="server">

      void Page_Load(Object sender, EventArgs e)
      {

         // Create an EventHandler delegate for the method you want
 to handle the event
         // and then add it to the list of methods called when the event
 is raised.
         Ad.AdCreated += new System.Web.UI.WebControls.AdCreatedEventHandler(this.AdCreated_Event);

      }

      void AdCreated_Event(Object sender, AdCreatedEventArgs e)
 
      {

         // Override the AlternateText value from the ads.xml file.
         e.AlternateText = "Visit this site!";   

      }      

   </script>
 
<body>
 
   <form runat="server">
 
      <h3>AdRotator AdCreated Example</h3>

      Notice that the AlternateText property of the advertisement <br>
      has been programmatically modified from the value in the
 XML <br>
      file. 

      <br><br>
 
      <asp:AdRotator id="Ad" runat="server"
           AdvertisementFile = "~/App_Data/Ads.xmla"
           Borderwidth="1"
           Target="_blank"/>
 
   </form>
 
</body>
</html>

継承階層継承階層
System.Object
   System.EventArgs
    System.Web.UI.WebControls.AdCreatedEventArgs
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
AdCreatedEventArgs メンバ
System.Web.UI.WebControls 名前空間
AdCreatedEventHandler
AdRotator
AdvertisementFile

AdCreatedEventArgs コンストラクタ

AdCreatedEventArgs クラス新しインスタンス初期化します。

名前空間: System.Web.UI.WebControls
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public Sub New ( _
    adProperties As IDictionary _
)
Dim adProperties As IDictionary

Dim instance As New AdCreatedEventArgs(adProperties)
public AdCreatedEventArgs (
    IDictionary adProperties
)
public:
AdCreatedEventArgs (
    IDictionary^ adProperties
)
public AdCreatedEventArgs (
    IDictionary adProperties
)
public function AdCreatedEventArgs (
    adProperties : IDictionary
)

パラメータ

adProperties

XML ファイルか取得した広告プロパティ格納されている System.Collections.IDictionary。

解説解説

このコンストラクタ使用してAdCreatedEventArgs クラス新しインスタンス作成し初期化します。

AdCreatedEventArgsインスタンス初期プロパティ値を次の表に示します

プロパティ

初期値

AdProperties

adProperties パラメータnull 参照 (Visual Basic では Nothing) でない場合は、adProperties パラメータの値。それ以外場合は、空の System.Collections.IDictionary

AlternateText

adProperties パラメータnull 参照 (Visual Basic では Nothing) でない場合は、代替テキストを示す adProperties パラメータの値。それ以外場合は String.Empty。

ImageUrl

adProperties パラメータnull 参照 (Visual Basic では Nothing) でない場合は、表示するイメージURL を示す adProperties パラメータの値。それ以外場合String.Empty

NavigateUrl

adProperties パラメータnull 参照 (Visual Basic では Nothing) でない場合は、移動先の URL を示す adProperties パラメータの値。それ以外場合String.Empty

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
AdCreatedEventArgs クラス
AdCreatedEventArgs メンバ
System.Web.UI.WebControls 名前空間
System.Collections.IDictionary
String.Empty

AdCreatedEventArgs プロパティ


パブリック プロパティパブリック プロパティ

参照参照

関連項目

AdCreatedEventArgs クラス
System.Web.UI.WebControls 名前空間
AdCreatedEventHandler
AdRotator
AdvertisementFile

AdCreatedEventArgs メソッド


AdCreatedEventArgs メンバ

AdRotator コントロールの AdCreated イベントデータ提供します。このクラス継承できません。

AdCreatedEventArgs データ型公開されるメンバを以下の表に示します


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド AdCreatedEventArgs AdCreatedEventArgs クラス新しインスタンス初期化します。
パブリック プロパティパブリック プロパティ
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

AdCreatedEventArgs クラス
System.Web.UI.WebControls 名前空間
AdCreatedEventHandler
AdRotator
AdvertisementFile



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「AdCreatedEventArgs」の関連用語

AdCreatedEventArgsのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



AdCreatedEventArgsのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS