System.Web.UI.Design.ResourceExpressionEditor.EvaluateExpression Method

Evaluates a resource expression and provides the design-time value for a control property.

Syntax

public override object EvaluateExpression (string expression, object parseTimeData, Type propertyType, IServiceProvider serviceProvider)

Parameters

expression
A resource expression to evaluate. expression does not include the Resources expression prefix.
parseTimeData
An object supplying additional parse data, in the form of a System.Web.Compilation.ResourceExpressionFields value.
propertyType
The type of the control property.
serviceProvider
A service provider implementation supplied by the designer host, used to obtain additional design-time services.

Returns

The object referenced by the evaluated expression string, if the expression evaluation succeeded; otherwise, null.

Remarks

The ResourceExpressionEditor.EvaluateExpression(string, object, Type, IServiceProvider) method looks up the resource that is specified by expression, and then returns the resource.

The visual designer uses the ResourceExpressionEditor.EvaluateExpression(string, object, Type, IServiceProvider) method to evaluate a resource expression and provide the design-time value for an associated control property. At run time, the page parser uses the System.Web.Compilation.ResourceExpressionBuilder.EvaluateExpression(object, System.Web.UI.BoundPropertyEntry, object, System.Web.Compilation.ExpressionBuilderContext) and System.Web.Compilation.ResourceExpressionBuilder.GetCodeExpression(System.Web.UI.BoundPropertyEntry, object, System.Web.Compilation.ExpressionBuilderContext) methods of the corresponding System.Web.Compilation.ResourceExpressionBuilder implementation to evaluate an expression and provide the run-time value for an associated control property.

The visual designer uses the System.Web.Compilation.ResourceExpressionBuilder.ParseExpression(string) method to parse the expression string at design time, and then calls the ResourceExpressionEditor.EvaluateExpression(string, object, Type, IServiceProvider) method with the parsed expression data.

Requirements

Namespace: System.Web.UI.Design
Assembly: System.Design (in System.Design.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0