RouteParameter.RouteKey 屬性

定義

取得或設定要從其中擷取路由參數值的路由區段名稱。

public:
 property System::String ^ RouteKey { System::String ^ get(); void set(System::String ^ value); };
public string RouteKey { get; set; }
member this.RouteKey : string with get, set
Public Property RouteKey As String

屬性值

String

包含參數值的路由區段名稱。

備註

當您定義路由模式時,您可以在 Web 要求 URL 中包含作為實際值預留位置的區段。 您可以用大括弧括住 ( 和 ) 來定義預留位置 { } 。 例如,格式的路由模式 blog/{action}/{entry} 包含名為和的預留位置 action entry 。 若要取出預留位置的值,請將 RouteKey 屬性設定為預留位置的名稱,並呼叫 Evaluate 方法。

適用於

另請參閱