TemplateContainerAttribute.BindingDirection プロパティ
アセンブリ: System.Web (system.web.dll 内)

Dim instance As TemplateContainerAttribute Dim value As BindingDirection value = instance.BindingDirection
コンテナ コントロールのバインディング方向を示す BindingDirection。既定値は OneWay です。

BindingDirection プロパティは、テンプレートがプロパティ値を受け入れるのみであることを示す OneWay フィールドと、テンプレートがプロパティ値を受け入れて、かつ公開することを示す TwoWay フィールドのいずれかになります。後者の場合、データ バインド コントロールは、Bind データ バインディング構文を使用して、自動的に、データ ソースの更新、削除、および挿入を実行できます。
データ バインディングの詳細については、「データベースへのバインド」と「データ バインディング式の構文」を参照してください。

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()); }

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からTemplateContainerAttribute.BindingDirection プロパティを検索する場合は、下記のリンクをクリックしてください。

- TemplateContainerAttribute.BindingDirection プロパティのページへのリンク