データ連結 ASP.NET サーバー コントロール プロパティの .NET Framework 型を取得します。
Public ReadOnly Property PropertyType As Type
[C#]
public Type PropertyType {get;}
[C++]
public: __property Type* get_PropertyType();
[JScript]
public function get PropertyType() : Type;
プロパティ値
データ連結プロパティの .NET Framework 型。
使用例
[Visual Basic, C#, C++] DataBinding のオブジェクト (myDataBinding2
) のさまざまなプロパティにアクセスする 3 つの変数 (dataBindingOutput1
、 dataBindingOutput2
、 dataBindingOutput3
) を宣言する例を次に示します。この例では、次に、 PropertyType プロパティの値を dataBindingOutput2
に代入し、文字列 "The property type is " と連結して、その結果の値をファイルに書き込んでいます。
' Use the DataBindingCollection.GetEnumerator method
' to iterate through the myDataBindingCollection object
' and write the PropertyName, PropertyType, and Expression
' properties to a file for each DataBinding object
' in the MyDataBindingCollection object.
myDataBindingCollection = DataBindings
Dim myEnumerator As IEnumerator = myDataBindingCollection.GetEnumerator()
While myEnumerator.MoveNext()
myDataBinding2 = CType(myEnumerator.Current, DataBinding)
Dim dataBindingOutput1, dataBindingOutput2, dataBindingOutput3 As [String]
dataBindingOutput1 = [String].Concat("The property name is ", myDataBinding2.PropertyName)
dataBindingOutput2 = [String].Concat("The property type is ", myDataBinding2.PropertyType.ToString(), "-", dataBindingOutput1)
dataBindingOutput3 = [String].Concat("The expression is ", myDataBinding2.Expression, "-", dataBindingOutput2)
WriteToFile(dataBindingOutput3)
myDataBindingExpression2 = [String].Concat("<%#", myDataBinding2.Expression, "%>")
myStringReplace2 = myDataBinding2.PropertyName.Replace(".", "-")
myHtmlControlDesignBehavior.SetAttribute(myStringReplace2, myDataBindingExpression2, True)
Dim index As Integer = myStringReplace2.IndexOf("-"c)
End While ' while loop ends
End Sub 'OnBindingsCollectionChanged
[C#]
// Use the DataBindingCollection.GetEnumerator method
// to iterate through the myDataBindingCollection object
// and write the PropertyName, PropertyType, and Expression
// properties to a file for each DataBinding object
// in the MyDataBindingCollection object.
myDataBindingCollection = DataBindings;
IEnumerator myEnumerator = myDataBindingCollection.GetEnumerator();
while(myEnumerator.MoveNext())
{
myDataBinding2 = (DataBinding)myEnumerator.Current;
String dataBindingOutput1,dataBindingOutput2,dataBindingOutput3;
dataBindingOutput1=String.Concat("The property name is ",myDataBinding2.PropertyName);
dataBindingOutput2=String.Concat("The property type is ",myDataBinding2.PropertyType.ToString(),"-",dataBindingOutput1);
dataBindingOutput3=String.Concat("The expression is ",myDataBinding2.Expression,"-",dataBindingOutput2);
WriteToFile(dataBindingOutput3);
myDataBindingExpression2 = String.Concat("<%#",myDataBinding2.Expression,"%>");
myStringReplace2 = myDataBinding2.PropertyName.Replace(".","-");
myHtmlControlDesignBehavior.SetAttribute(myStringReplace2,myDataBindingExpression2,true);
int index = myStringReplace2.IndexOf('-');
}// while loop ends
[C++]
// Use the DataBindingCollection::GetEnumerator method
// to iterate through the myDataBindingCollection object
// and write the PropertyName, PropertyType, and Expression
// properties to a file for each DataBinding object
// in the MyDataBindingCollection object.
myDataBindingCollection = DataBindings;
IEnumerator* myEnumerator = myDataBindingCollection->GetEnumerator();
while(myEnumerator->MoveNext()) {
myDataBinding2 = dynamic_cast<DataBinding*>(myEnumerator->Current);
String* dataBindingOutput1, *dataBindingOutput2, *dataBindingOutput3;
dataBindingOutput1=String::Concat(S"The property name is ",
myDataBinding2->PropertyName);
dataBindingOutput2=String::Concat(S"The property type is ",
myDataBinding2->PropertyType, S"-", dataBindingOutput1);
dataBindingOutput3=String::Concat(S"The expression is ",
myDataBinding2->Expression, S"-", dataBindingOutput2);
WriteToFile(dataBindingOutput3);
myDataBindingExpression2 =
String::Concat(S"<%#", myDataBinding2->Expression, S"%>");
myStringReplace2 = myDataBinding2->PropertyName->Replace(S".", S"-");
myHtmlControlDesignBehavior->SetAttribute(myStringReplace2, myDataBindingExpression2, true);
int index = myStringReplace2->IndexOf('-');
}// while loop ends
[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン をクリックします。
必要条件
プラットフォーム: Windows 2000, Windows XP Professional, Windows Server 2003 ファミリ