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 參數的值。

建構函式

名稱 Description
RouteValueExpressionBuilder()

初始化 RouteValueExpressionBuilder 類別的新執行個體。

屬性

名稱 Description
SupportsEvaluate

會得到一個值,表示某表達式是否能在未編譯的頁面中被評估。

方法

名稱 Description
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)

適用於

另請參閱