Share via


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)

適用於

另請參閱