System.Web.Compilation.ConnectionStringsExpressionBuilder.EvaluateExpression Method

Returns a value from the <connectionStrings> section of the Web.config file.

Syntax

public override object EvaluateExpression (object target, System.Web.UI.BoundPropertyEntry entry, object parsedData, ExpressionBuilderContext context)

Parameters

target
The object that contains the expression.
entry
The property to which the expression is bound.
parsedData
The object that represents parsed data as returned by ConnectionStringsExpressionBuilder.ParseExpression(string, Type, ExpressionBuilderContext).
context
Properties for the control or page.

Returns

The object associated with a key in the <connectionStrings> section of the Web.config file.

Remarks

This method is called when an expression of the form <%$ ConnectionStrings: secureConnectionString %> is encountered in a page that is not compiled. It retrieves the appropriate value from the <connectionStrings> section of the Web.config file. This method overrides the ExpressionBuilder.EvaluateExpression(object, System.Web.UI.BoundPropertyEntry, object, ExpressionBuilderContext) method by calling the ConnectionStringsExpressionBuilder.GetConnectionString(string) method if a connection string is included in the parsedData parameter, or by calling the ConnectionStringsExpressionBuilder.GetConnectionStringProviderName(string) method if a connection string is not included in the parsedData parameter.

Requirements

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