System.Web.UI.Design.ConnectionStringsExpressionEditor.EvaluateExpression Method

Evaluates a connection string 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 connection string expression to evaluate. The expression does not include the ConnectionStrings expression prefix.
parseTimeData
An object containing additional parsing information for evaluating the expression.
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 ConnectionStringsExpressionEditor.EvaluateExpression(string, object, Type, IServiceProvider) method looks up the connection name and type specified by expression, and then returns the connection.

The visual designer uses the ConnectionStringsExpressionEditor.EvaluateExpression(string, object, Type, IServiceProvider) method to evaluate a connection string expression and provide the design-time value for an associated control property. The visual designer uses the System.Web.Compilation.ConnectionStringsExpressionBuilder.ParseExpression(string, Type, System.Web.Compilation.ExpressionBuilderContext) method to parse the expression string at design time, and then calls the ConnectionStringsExpressionEditor.EvaluateExpression(string, object, Type, IServiceProvider) method with the parsed expression data. The visual designer 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.ConnectionStringsExpressionBuilder.EvaluateExpression(object, System.Web.UI.BoundPropertyEntry, object, System.Web.Compilation.ExpressionBuilderContext) and System.Web.Compilation.ConnectionStringsExpressionBuilder.GetCodeExpression(System.Web.UI.BoundPropertyEntry, object, System.Web.Compilation.ExpressionBuilderContext) methods of the corresponding System.Web.Compilation.ConnectionStringsExpressionBuilder 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