RouteValueExpressionBuilder 类

定义

检索与路由页中的指定 URL 参数对应的值。

public ref class RouteValueExpressionBuilder : System::Web::Compilation::ExpressionBuilder
public class RouteValueExpressionBuilder : System.Web.Compilation.ExpressionBuilder
type RouteValueExpressionBuilder = class
    inherit ExpressionBuilder
Public Class RouteValueExpressionBuilder
Inherits ExpressionBuilder
继承
RouteValueExpressionBuilder

示例

以下示例演示如何使用标记显示 URL 参数 searchterm的值。 路由是使用 http://www.contoso.com/search/{searchterm} URL 模式定义的。

<asp:Label ID="Label1" runat="server"
    text="<%$ RouteValue:searchterm %>">
</asp:Label>

如果使用 URL http://www.contoso.com/search/Bicycles请求页面,控件 Label 将显示“自行车”。

注解

通过 RouteValueExpressionBuilder 类,可以使用标记将服务器控件的属性设置为路由页中某个 URL 参数的值。

构造函数

名称 说明
RouteValueExpressionBuilder()

初始化 RouteValueExpressionBuilder 类的新实例。

属性

名称 说明
SupportsEvaluate

获取一个值,该值指示是否可以在未编译的页面中计算表达式。

方法

名称 说明
Equals(Object)

确定指定的对象是否等于当前对象。

(继承自 Object)
EvaluateExpression(Object, BoundPropertyEntry, Object, ExpressionBuilderContext)

检索与指定路由键对应的值。

GetCodeExpression(BoundPropertyEntry, Object, ExpressionBuilderContext)

返回一个代码表达式,该表达式用于在生成的页类中执行属性赋值。

GetHashCode()

用作默认哈希函数。

(继承自 Object)
GetRouteValue(Page, String, Type, String)

检索与指定 URL 参数对应的值。

GetType()

获取当前实例的 Type

(继承自 Object)
MemberwiseClone()

创建当前 Object的浅表副本。

(继承自 Object)
ParseExpression(String, Type, ExpressionBuilderContext)

在派生类中重写时,返回一个表示已分析表达式的对象。

(继承自 ExpressionBuilder)
ToString()

返回一个表示当前对象的字符串。

(继承自 Object)

适用于

另请参阅