Export (0) Print
Expand All

RouteValueExpressionBuilder Class

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

System.Object
  System.Web.Compilation.ExpressionBuilder
    System.Web.Compilation.RouteValueExpressionBuilder

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

public class RouteValueExpressionBuilder : ExpressionBuilder

The RouteValueExpressionBuilder type exposes the following members.

  NameDescription
Public methodRouteValueExpressionBuilderInitializes a new instance of the RouteValueExpressionBuilder class.
Top

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

  NameDescription
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public methodEvaluateExpressionRetrieves the value that corresponds to a specified route key. (Overrides ExpressionBuilder.EvaluateExpression(Object, BoundPropertyEntry, Object, ExpressionBuilderContext).)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetCodeExpressionReturns a code expression that is used to perform the property assignment in the generated page class. (Overrides ExpressionBuilder.GetCodeExpression(BoundPropertyEntry, Object, ExpressionBuilderContext).)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodStatic memberGetRouteValueRetrieves the value that corresponds to the specified URL parameter.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodParseExpressionWhen overridden in a derived class, returns an object that represents the parsed expression. (Inherited from ExpressionBuilder.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

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 http://www.contoso.com/search/{searchterm} as the URL pattern.

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

If the page is requested with the URL http://www.contoso.com/search/Bicycles, the Label control displays "Bicycles".

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

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