TemplateControl.Eval TemplateControl.Eval TemplateControl.Eval TemplateControl.Eval Method

定義

提供在執行階段時對物件剖析並評估資料繫結運算式的支援。Provides support for parsing and evaluating a data-binding expression against an object at run time.

多載

Eval(String) Eval(String) Eval(String) Eval(String)

評估資料繫結運算式。Evaluates a data-binding expression.

Eval(String, String) Eval(String, String) Eval(String, String) Eval(String, String)

使用指定的格式字串評估資料繫結運算式以顯示結果。Evaluates a data-binding expression using the specified format string to display the result.

Eval(String) Eval(String) Eval(String) Eval(String)

評估資料繫結運算式。Evaluates a data-binding expression.

protected public:
 System::Object ^ Eval(System::String ^ expression);
protected internal object Eval (string expression);
member this.Eval : string -> obj
Protected Friend Function Eval (expression As String) As Object

參數

expression
String String String String

巡覽路徑,從容器至要置於繫結控制項屬性中的公用屬性值。The navigation path from the container to the public property value to place in the bound control property.

傳回

從資料繫結運算式的評估產生的物件。An object that results from the evaluation of the data-binding expression.

例外狀況

資料繫結方法只能用於 Page 包含的控制項。The data-binding method can be used only for controls contained on a Page.

expressionnullexpression is null.

-或--or- expression 為空字串 ("")。expression is an empty string ("").

備註

的值expression必須評估為公用屬性。The value of expression must evaluate to a public property.

方法會DataBinder.Eval 使用GetDataItem方法呼叫方法, 以解析運算式評估時所針對的物件參考。 EvalThe Eval method calls the DataBinder.Eval method using the GetDataItem method to resolve the object reference that the expression is evaluated against.

另請參閱

Eval(String, String) Eval(String, String) Eval(String, String) Eval(String, String)

使用指定的格式字串評估資料繫結運算式以顯示結果。Evaluates a data-binding expression using the specified format string to display the result.

protected public:
 System::String ^ Eval(System::String ^ expression, System::String ^ format);
protected internal string Eval (string expression, string format);
member this.Eval : string * string -> string
Protected Friend Function Eval (expression As String, format As String) As String

參數

expression
String String String String

巡覽路徑,從容器至要置於繫結控制項屬性中的公用屬性值。The navigation path from the container to the public property value to place in the bound control property.

format
String String String String

要套用到結果的 .NET Framework 格式字串。A .NET Framework format string to apply to the result.

傳回

從資料繫結運算式評估和字串型別轉換所產生的字串。A string that results from the evaluation of the data-binding expression and conversion to a string type.

例外狀況

資料繫結方法只能用於 Page 包含的控制項。The data-binding method can only be used for controls contained on a Page.

expressionnullexpression is null.

-或--or- expression 為空字串 ("")。expression is an empty string ("").

備註

的值expression必須評估為公用屬性。The value of expression must evaluate to a public property.

方法會Eval 使用GetDataItem方法呼叫方法, 以解析運算式評估時所針對的物件參考。 EvalThe Eval method calls the Eval method using the GetDataItem method to resolve the object reference that the expression is evaluated against.

另請參閱

適用於