RouteValueExpressionBuilder Class

.NET Framework (current version)

The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Retrieves the value that corresponds to a specified URL parameter in a routed page.

Namespace:   System.Web.Compilation
Assembly:  System.Web (in System.Web.dll)


public class RouteValueExpressionBuilder : ExpressionBuilder


Initializes a new instance of the RouteValueExpressionBuilder class.


Gets a value that indicates whether an expression can be evaluated in a page that is not compiled.(Overrides ExpressionBuilder.SupportsEvaluate.)


Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_pubmethodEvaluateExpression(Object, BoundPropertyEntry, Object, ExpressionBuilderContext)

Retrieves the value that corresponds to a specified route key.(Overrides ExpressionBuilder.EvaluateExpression(Object, BoundPropertyEntry, Object, ExpressionBuilderContext).)


Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetCodeExpression(BoundPropertyEntry, Object, ExpressionBuilderContext)

Returns a code expression that is used to perform the property assignment in the generated page class.(Overrides ExpressionBuilder.GetCodeExpression(BoundPropertyEntry, Object, ExpressionBuilderContext).)


Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodSystem_CAPS_staticGetRouteValue(Page, String, Type, String)

Retrieves the value that corresponds to the specified URL parameter.


Gets the Type of the current instance.(Inherited from Object.)


Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodParseExpression(String, Type, ExpressionBuilderContext)

When overridden in a derived class, returns an object that represents the parsed expression.(Inherited from ExpressionBuilder.)


Returns a string that represents the current object.(Inherited from Object.)

The RouteValueExpressionBuilder class makes it possible to use markup to set the property of a server control to the value of one of the URL parameters in a routed page.

The following example shows how to use markup to display the value of the URL parameter searchterm. The route is defined by using{searchterm} as the URL pattern.

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

If the page is requested with the URL, the Label control displays "Bicycles".

.NET Framework
Available since 4.0

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top