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 将显示"Bicycles"。

注解

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

构造函数

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)

适用于

另请参阅