System.Web.UI.Design.AppSettingsExpressionEditor.EvaluateExpression Method

Evaluates an application setting expression string 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
An application setting expression string to evaluate. expression does not include the AppSettings expression prefix.
parseTimeData
An object containing additional parsing information for evaluating expression.
propertyType
The control property type.
serviceProvider
A service provider implementation supplied by the designer host, used to obtain additional design-time services.

Returns

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

Remarks

The AppSettingsExpressionEditor.EvaluateExpression(string, object, Type, IServiceProvider) method looks up the application setting that is specified by expression, and then returns the value of the application setting.

The visual designer uses the AppSettingsExpressionEditor.EvaluateExpression(string, object, Type, IServiceProvider) method to evaluate an application setting expression and provide the design-time value for an associated control property. The visual designer calls the AppSettingsExpressionEditor.EvaluateExpression(string, object, Type, IServiceProvider) method with the expression string, and uses the evaluated expression result to assign control property values that are rendered on the design surface.

At run time, the page parser uses the System.Web.Compilation.AppSettingsExpressionBuilder.EvaluateExpression(object, System.Web.UI.BoundPropertyEntry, object, System.Web.Compilation.ExpressionBuilderContext) and System.Web.Compilation.AppSettingsExpressionBuilder.GetCodeExpression(System.Web.UI.BoundPropertyEntry, object, System.Web.Compilation.ExpressionBuilderContext) methods of the corresponding System.Web.Compilation.AppSettingsExpressionBuilder implementation to evaluate an expression and provide the run-time value for an associated control property.

Requirements

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