AppSettingsExpressionBuilder.EvaluateExpression(Object, BoundPropertyEntry, Object, ExpressionBuilderContext) 方法

定义

从 Web.config 文件的 <appSettings> 节返回一个值。Returns a value from the <appSettings> section of the Web.config file.

public:
 override System::Object ^ EvaluateExpression(System::Object ^ target, System::Web::UI::BoundPropertyEntry ^ entry, System::Object ^ parsedData, System::Web::Compilation::ExpressionBuilderContext ^ context);
public override object EvaluateExpression (object target, System.Web.UI.BoundPropertyEntry entry, object parsedData, System.Web.Compilation.ExpressionBuilderContext context);
override this.EvaluateExpression : obj * System.Web.UI.BoundPropertyEntry * obj * System.Web.Compilation.ExpressionBuilderContext -> obj
Public Overrides Function EvaluateExpression (target As Object, entry As BoundPropertyEntry, parsedData As Object, context As ExpressionBuilderContext) As Object

参数

target
Object

包含属性项的对象。The object that contains the property entry.

entry
BoundPropertyEntry

表达式绑定到的属性。The property to which the expression is bound.

parsedData
Object

表示由 ParseExpression(String, Type, ExpressionBuilderContext) 返回的已分析数据的对象。The object that represents parsed data as returned by ParseExpression(String, Type, ExpressionBuilderContext).

context
ExpressionBuilderContext

控件或页的属性。Properties for the control or page.

返回

Object

与 Web.config 文件的 <appSettings> 部分中某个键关联的 ObjectThe Object associated with a key in the <appSettings> section of the Web.config file.

注解

<%$ AppSettings: someApplicationSetting %> 在无编译页中遇到形式的表达式时,将调用此方法。This method is called when an expression of the form <%$ AppSettings: someApplicationSetting %> is encountered in a no-compile page. 它从 Web.config 文件的部分中的键/值对中检索相应的值 <appSettings>It retrieves the appropriate value from the key/value pairs in the <appSettings> section of the Web.config file. 此方法重写,方法是 EvaluateExpression 调用 GetAppSetting 具有 Expression 属性作为参数的方法 keyName 属性上的属性 PropertyEntry.PropertyInfo 作为 propertyName 参数,以及参数的 Type target 作为 targetType 参数。This method overrides EvaluateExpression by calling the GetAppSetting method with the Expression property as the key parameter, the Name property on the PropertyEntry.PropertyInfo property as the propertyName parameter, and the Type of the target parameter as the targetType parameter.

适用于

另请参阅