TemplateControl.Eval Method

Definition

Provides support for parsing and evaluating a data-binding expression against an object at run time.

Overloads

Eval(String)

Evaluates a data-binding expression.

Eval(String, String)

Evaluates a data-binding expression using the specified format string to display the result.

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

Parameters

expression
String

The navigation path from the container to the public property value to place in the bound control property.

Returns

An object that results from the evaluation of the data-binding expression.

Exceptions

The data-binding method can be used only for controls contained on a Page.

expression is null.

-or-

expression is an empty string ("").

Remarks

The value of expression must evaluate to a public property.

The Eval method calls the DataBinder.Eval method using the GetDataItem method to resolve the object reference that the expression is evaluated against.

See also

Applies to

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

Parameters

expression
String

The navigation path from the container to the public property value to place in the bound control property.

format
String

A .NET Framework format string to apply to the result.

Returns

A string that results from the evaluation of the data-binding expression and conversion to a string type.

Exceptions

The data-binding method can only be used for controls contained on a Page.

expression is null.

-or-

expression is an empty string ("").

Remarks

The value of expression must evaluate to a public property.

The Eval method calls the Eval method using the GetDataItem method to resolve the object reference that the expression is evaluated against.

See also

Applies to