TemplateContainerAttribute.BindingDirection プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > TemplateContainerAttribute.BindingDirection プロパティの意味・解説 

TemplateContainerAttribute.BindingDirection プロパティ

メモ : このプロパティは、.NET Framework version 2.0 で新しく追加されたものです。

コンテナ コントロールのバインディング方向を取得します。

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

Public ReadOnly Property
 BindingDirection As BindingDirection
Dim instance As TemplateContainerAttribute
Dim value As BindingDirection

value = instance.BindingDirection
public BindingDirection BindingDirection { get;
 }
public:
property BindingDirection BindingDirection {
    BindingDirection get ();
}
/** @property */
public BindingDirection get_BindingDirection ()
public function get BindingDirection
 () : BindingDirection

プロパティ値
コンテナ コントロールのバインディング方向を示す BindingDirection。既定値は OneWay です。

解説解説
使用例使用例

TemplatedFirstControl という名前の template 宣言されたコントロールを作成し、このコントロールを FirstTemplateContainer という名前のコンテナと関連付ける方法を次のコード例に示します。このコード例では、テンプレートが指定されない場合はサーバー時間を表示し、テンプレートが指定される場合はテンプレートの内容を表示するカスタム コントロールが作成されます。GetCustomAttribute メソッドが、TemplateFirstControl の FirstTemplate プロパティの BindingDirection プロパティを判断します。

このコード例は、TemplateContainerAttribute クラスのトピックで取り上げているコード例の一部分です。

' Get the class type for which to access metadata.
Dim clsType As Type = GetType(VB_TemplatedFirstControl)
' Get the PropertyInfo object for FirstTemplate.
Dim pInfo As PropertyInfo = clsType.GetProperty("FirstTemplate")
' See if the TemplateContainer attribute is defined for this property.
Dim isDef As Boolean = Attribute.IsDefined(pInfo,
 GetType(TemplateContainerAttribute))
' Display the result if the attribute exists.
If isDef Then
  Dim tca As TemplateContainerAttribute = CType(Attribute.GetCustomAttribute(pInfo,
 GetType(TemplateContainerAttribute)), TemplateContainerAttribute)
  Response.Write("The binding direction is: " &
 tca.BindingDirection.ToString())
End If
// Get the class type for which to access metadata.
Type clsType = typeof(TemplatedFirstControl);
// Get the PropertyInfo object for FirstTemplate.
PropertyInfo pInfo = clsType.GetProperty("FirstTemplate");
// See if the TemplateContainer attribute is defined for this property.
bool isDef = Attribute.IsDefined(pInfo, typeof(TemplateContainerAttribute));
// Display the result if the attribute exists.
if (isDef)
{
  TemplateContainerAttribute tca =
    (TemplateContainerAttribute)Attribute.GetCustomAttribute(pInfo, typeof(TemplateContainerAttribute));
  Response.Write("The binding direction is: " + tca.BindingDirection.ToString());
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
TemplateContainerAttribute クラス
TemplateContainerAttribute メンバ
System.Web.UI 名前空間
ContainerType
BindingDirection
GetCustomAttribute
その他の技術情報
データベースへのバインド
データ バインディング式の構文



英和和英テキスト翻訳

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

辞書ショートカット

すべての辞書の索引

「TemplateContainerAttribute.BindingDirection プロパティ」の関連用語

TemplateContainerAttribute.BindingDirection プロパティのお隣キーワード
検索ランキング

   

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



TemplateContainerAttribute.BindingDirection プロパティのページの著作権

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

©2026 GRAS Group, Inc.RSS